@midscene/test 1.15.2-beta-20261012123219.0 → 1.15.2
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/cli/index.mjs +235 -129
- package/dist/es/cli/index.mjs.map +1 -1
- package/dist/es/index.mjs +72 -106
- package/dist/es/index.mjs.map +1 -1
- package/dist/es/midscene/index.mjs +54 -30
- package/dist/es/midscene/index.mjs.map +1 -1
- package/dist/es/test-cli.mjs +237 -130
- package/dist/es/test-cli.mjs.map +1 -1
- package/dist/lib/cli/index.js +233 -127
- package/dist/lib/cli/index.js.map +1 -1
- package/dist/lib/index.js +70 -110
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/midscene/index.js +53 -29
- package/dist/lib/midscene/index.js.map +1 -1
- package/dist/lib/test-cli.js +236 -129
- package/dist/lib/test-cli.js.map +1 -1
- package/dist/types/cli/index.d.ts +10 -6
- package/dist/types/index.d.ts +1 -85
- package/dist/types/midscene/index.d.ts +3 -1
- package/package.json +13 -13
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"midscene/index.js","sources":["webpack/runtime/define_property_getters","webpack/runtime/has_own_property","webpack/runtime/make_namespace_object","../../../src/node/define-node.ts","../../../src/midscene/index.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 { defineNode as coreDefineNode } from '@midscene/core/internal/test-runner';\nimport type {\n DefineNodeOptions,\n DefineNodeWithSchemaOptions,\n NodeDefinition,\n NodeDefinitionWithSchema,\n NodeInputSchema,\n} from './types';\n\n// A type-only facade: validation and execution still belong to the shared kernel.\ninterface DefineNativeNode {\n <TSchema extends NodeInputSchema, TData = unknown, TContext = unknown>(\n options: DefineNodeWithSchemaOptions<TSchema, TData, TContext>,\n ): NodeDefinitionWithSchema<TSchema, TData, TContext>;\n <TInput = unknown, TData = unknown, TContext = unknown>(\n options: DefineNodeOptions<TInput, TData, TContext>,\n ): NodeDefinition<TInput, TData, TContext>;\n}\nexport const defineNode: DefineNativeNode = coreDefineNode;\n","import {\n type AgentTestRunnerNodeDefinition,\n type AgentTestRunnerNodeProvider,\n type CommonAgentTestRunnerApi,\n aiActInputSchema,\n aiActOptionsInputSchema,\n aiAssertInputSchema,\n aiAssertOptionsInputSchema,\n aiTapInputSchema,\n insightInputSchema,\n insightOptionsInputSchema,\n locateOptionsInputSchema,\n promptImageInputSchema,\n recordToReportInputSchema,\n recordToReportOptionsInputSchema,\n reportScreenshotInputSchema,\n structuredUserPromptInputSchema,\n userPromptInputSchema,\n} from '@midscene/core/agent/test';\nimport {\n type WorkflowReportSource,\n assertResourceAvailable,\n trackResourceOperation,\n} from '@midscene/core/internal/test-runner';\nimport {\n enterYamlAction,\n enterYamlExecution,\n runInYamlExecutionContext,\n} from '@midscene/core/internal/yaml-runtime';\nimport { getDebug } from '@midscene/shared/logger';\nimport { z } from 'zod/v4';\nimport type { Awaitable } from '../engine/types';\nimport { NodeDefinitionError } from '../errors';\nimport { defineNode } from '../node/define-node';\nimport type { NodeDefinition, NodeExecutionContext } from '../node/types';\n\nexport type MidsceneUIAgent = CommonAgentTestRunnerApi & {\n _prepareForTestRunner?(): void;\n _createReportSource?(\n scopeId: string,\n ): Promise<WorkflowReportSource | undefined>;\n flushReport?(): Promise<string | undefined>;\n addDumpUpdateListener?(\n listener: (dump: string, execution?: MidsceneExecutionRef) => void,\n ): () => void;\n};\n\nexport {\n actionInputSchema,\n aiDragAndDropInputSchema,\n aiInputInputSchema,\n aiKeyboardPressInputSchema,\n aiLongPressInputSchema,\n aiPinchInputSchema,\n aiQueryInputSchema,\n aiScrollInputSchema,\n aiWaitForInputSchema,\n javascriptInputSchema,\n runGherkinScenarioInputSchema,\n setAIContextInputSchema,\n} from '@midscene/core/agent/test';\nexport type {\n ActionNodeInput,\n AiDragAndDropNodeInput,\n AiInputNodeInput,\n AiKeyboardPressNodeInput,\n AiLongPressNodeInput,\n AiPinchNodeInput,\n AiQueryNodeInput,\n AiScrollNodeInput,\n AiWaitForNodeInput,\n JavascriptNodeInput,\n RunGherkinScenarioNodeInput,\n SetAIContextNodeInput,\n} from '@midscene/core/agent/test';\n\nexport {\n aiActInputSchema,\n aiActOptionsInputSchema,\n aiAssertInputSchema,\n aiAssertOptionsInputSchema,\n aiTapInputSchema,\n insightInputSchema,\n insightOptionsInputSchema,\n locateOptionsInputSchema,\n promptImageInputSchema,\n recordToReportInputSchema,\n recordToReportOptionsInputSchema,\n reportScreenshotInputSchema,\n structuredUserPromptInputSchema,\n userPromptInputSchema,\n};\n\nexport interface MidsceneExecutionRef {\n id?: string;\n}\n\nexport interface AgentProvider<TContext> {\n getAgent(\n runId: string,\n execution: NodeExecutionContext<unknown, TContext>,\n ): Awaitable<MidsceneUIAgent>;\n // biome-ignore lint/suspicious/noConfusingVoidType: providers without a report intentionally return void.\n releaseAgent?(runId: string): Awaitable<AgentReleaseResult | void>;\n dispose?(): Awaitable<void>;\n}\n\nexport interface AgentReleaseResult {\n /** Absolute path to the finalized report for this Agent scope. */\n reportPath?: string;\n}\n\nexport const waitInputSchema = z.strictObject({\n duration: z.number().positive().describe('How long to wait.'),\n unit: z\n .enum(['ms', 's', 'min'])\n .default('ms')\n .describe('Duration unit: milliseconds, seconds, or minutes.'),\n});\n\nexport type AiActNodeInput = z.infer<typeof aiActInputSchema>;\nexport type AiAssertNodeInput = z.infer<typeof aiAssertInputSchema>;\nexport type AiTapNodeInput = z.infer<typeof aiTapInputSchema>;\nexport type InsightNodeInput = z.infer<typeof insightInputSchema>;\nexport type RecordToReportNodeInput = z.infer<typeof recordToReportInputSchema>;\nexport type WaitNodeInput = z.infer<typeof waitInputSchema>;\n\nexport interface CreateMidsceneNodesOptions<TContext> {\n getAgent?(\n execution: NodeExecutionContext<unknown, TContext>,\n ): Awaitable<MidsceneUIAgent>;\n agentProvider?: AgentProvider<TContext>;\n /** Agent class that declares the Agent-backed Nodes to register. */\n agentClass: AgentTestRunnerNodeProvider;\n}\n\nconst waitFor = async (durationMs: number, signal: AbortSignal) => {\n if (signal.aborted) {\n throw signal.reason ?? new Error('Wait aborted.');\n }\n await new Promise<void>((resolve, reject) => {\n const timeout = setTimeout(() => {\n signal.removeEventListener('abort', abort);\n resolve();\n }, durationMs);\n const abort = () => {\n clearTimeout(timeout);\n reject(signal.reason ?? new Error('Wait aborted.'));\n };\n signal.addEventListener('abort', abort, { once: true });\n });\n};\n\n/** Adapt Agent-owned descriptions to executable Midscene Test Nodes. */\nexport const createAgentTestRunnerNodes = <TContext>(\n definitions: readonly AgentTestRunnerNodeDefinition[],\n getAgent: (\n ctx: NodeExecutionContext<unknown, TContext>,\n ) => Awaitable<unknown>,\n): readonly NodeDefinition<any, any, TContext>[] => {\n const runAgentCall = async <T>(\n node: string,\n ctx: NodeExecutionContext<unknown, TContext>,\n agent: MidsceneUIAgent,\n call: () => Promise<T>,\n captureExecutions = true,\n ): Promise<T> =>\n runInYamlExecutionContext(async () => {\n const scopeId =\n ctx.scope === 'case' ? ctx.case.runId : ctx.document.documentRunId;\n const isCleanupOwner = assertResourceAvailable(agent, true, ctx.signal);\n // Native Steps own the root report. Any Agent.runYaml invoked underneath\n // contributes to that Step instead of publishing another root snapshot.\n const yamlBoundary = enterYamlExecution(agent, {\n allowIndependentOverlap: isCleanupOwner,\n });\n const leaveYamlAction = enterYamlAction(agent, ctx.signal);\n let removeListener: (() => void) | undefined;\n let sawExecutionWithoutId = false;\n const stopListening = () => {\n const remove = removeListener;\n removeListener = undefined;\n remove?.();\n };\n const stopListeningOnAbort = () => stopListening();\n try {\n if (captureExecutions && agent.addDumpUpdateListener) {\n removeListener = agent.addDumpUpdateListener((_dump, execution) => {\n if (!execution) return;\n if (!execution.id) {\n sawExecutionWithoutId = true;\n return;\n }\n ctx.report.addTrace({\n type: 'midscene-execution',\n executionId: execution.id,\n });\n });\n if (ctx.signal.aborted) stopListening();\n else {\n ctx.signal.addEventListener('abort', stopListeningOnAbort, {\n once: true,\n });\n }\n }\n return await trackResourceOperation(\n agent,\n Promise.resolve().then(call),\n ctx.signal,\n );\n } finally {\n leaveYamlAction();\n yamlBoundary.finish();\n ctx.signal.removeEventListener('abort', stopListeningOnAbort);\n stopListening();\n if (sawExecutionWithoutId) {\n warnReportTrace(\n `Skipped a report trace without a stable execution id for ${node} in scope ${scopeId}.`,\n );\n }\n }\n });\n\n return definitions.map((definition) =>\n defineNode({\n name: definition.name,\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(ctx) {\n const agent = await getAgent(ctx);\n ctx.signal.throwIfAborted();\n const call = async () =>\n definition.execute(agent, ctx.input, { signal: ctx.signal });\n if (typeof agent !== 'object' || agent === null) return call();\n return runAgentCall(\n definition.name,\n ctx,\n agent as MidsceneUIAgent,\n call,\n );\n },\n }),\n );\n};\n\nconst warnReportTrace = getDebug('test-runner:report-trace', {\n console: true,\n});\n\nexport function createMidsceneNodes<TContext>(\n options: CreateMidsceneNodesOptions<TContext>,\n): readonly NodeDefinition<any, any, TContext>[] {\n if (!options || typeof options !== 'object') {\n throw new NodeDefinitionError(\n 'createMidsceneNodes() options must be an object.',\n );\n }\n if (\n typeof options.agentProvider?.getAgent !== 'function' &&\n typeof options.getAgent !== 'function'\n ) {\n throw new NodeDefinitionError(\n 'createMidsceneNodes() requires getAgent or agentProvider.getAgent.',\n );\n }\n if (\n !options.agentClass ||\n typeof options.agentClass.getTestRunnerNodeDefinitions !== 'function'\n ) {\n throw new NodeDefinitionError(\n 'createMidsceneNodes() requires agentClass.getTestRunnerNodeDefinitions().',\n );\n }\n\n const agentsByScope = new Map<string, Set<MidsceneUIAgent>>();\n const getAgent = async (\n ctx: NodeExecutionContext<unknown, TContext>,\n ): Promise<MidsceneUIAgent> => {\n const runId =\n ctx.scope === 'case' ? ctx.case.runId : ctx.document.documentRunId;\n let agents = agentsByScope.get(runId);\n if (!agents) {\n agents = new Set();\n agentsByScope.set(runId, agents);\n const ownedScope = agents;\n ctx.onTeardown(async () => {\n const errors: unknown[] = [];\n const reportPaths: string[] = [];\n const reportSources: WorkflowReportSource[] = [];\n try {\n for (const agent of ownedScope) {\n try {\n const path = await agent.flushReport?.();\n if (path) reportPaths.push(path);\n const source = await agent._createReportSource?.(runId);\n if (source) reportSources.push(source);\n } catch (error) {\n errors.push(error);\n }\n }\n // Publication failure never prevents the owner from disposing its Agent.\n try {\n const released = await options.agentProvider?.releaseAgent?.(runId);\n if (\n released?.reportPath &&\n !reportPaths.includes(released.reportPath)\n )\n reportPaths.push(released.reportPath);\n } catch (error) {\n errors.push(error);\n }\n if (errors.length === 1) throw errors[0];\n if (errors.length)\n throw new AggregateError(\n errors,\n 'Agent report publication and release failed',\n );\n return {\n reportPaths,\n ...(reportSources.length ? { reportSources } : {}),\n };\n } finally {\n agentsByScope.delete(runId);\n }\n });\n }\n const scopeAgents = agents;\n // Acquisition can outlive cancellation. Teardown waits for actual settlement.\n return trackResourceOperation(\n {},\n Promise.resolve().then(async () => {\n const agent = options.agentProvider\n ? await options.agentProvider.getAgent(runId, ctx)\n : await options.getAgent!(ctx);\n agent._prepareForTestRunner?.();\n scopeAgents.add(agent);\n return agent;\n }),\n ctx.signal,\n );\n };\n\n const agentDefinitions = options.agentClass.getTestRunnerNodeDefinitions();\n\n return [\n ...createAgentTestRunnerNodes(agentDefinitions, getAgent),\n defineNode<typeof waitInputSchema, unknown, TContext>({\n name: 'wait',\n description: 'Wait for a fixed duration while honoring cancellation.',\n stringInputKey: false,\n inputSchema: waitInputSchema,\n async execute(execution) {\n const multiplier =\n execution.input.unit === 'min'\n ? 60_000\n : execution.input.unit === 's'\n ? 1_000\n : 1;\n const durationMs = execution.input.duration * multiplier;\n await waitFor(durationMs, execution.signal);\n return { summary: `Waited ${durationMs}ms` };\n },\n }),\n ];\n}\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","defineNode","coreDefineNode","waitInputSchema","z","waitFor","durationMs","signal","Error","Promise","resolve","reject","timeout","setTimeout","abort","clearTimeout","createAgentTestRunnerNodes","definitions","getAgent","runAgentCall","node","ctx","agent","call","captureExecutions","runInYamlExecutionContext","scopeId","isCleanupOwner","assertResourceAvailable","yamlBoundary","enterYamlExecution","leaveYamlAction","enterYamlAction","removeListener","sawExecutionWithoutId","stopListening","remove","undefined","stopListeningOnAbort","_dump","execution","trackResourceOperation","warnReportTrace","getDebug","createMidsceneNodes","options","NodeDefinitionError","agentsByScope","Map","runId","agents","Set","ownedScope","errors","reportPaths","reportSources","path","source","error","released","AggregateError","scopeAgents","agentDefinitions","multiplier"],"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,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;YAChB,OAAOA;QACT,IACAD,IAAI,MAAM;IAEd;IAEA,MAAMyC,mBAAmBjB,QAAQ,UAAU,CAAC,4BAA4B;IAExE,OAAO;WACF7B,2BAA2B8C,kBAAkB5C;QAChDjB,WAAsD;YACpD,MAAM;YACN,aAAa;YACb,gBAAgB;YAChB,aAAaE;YACb,MAAM,SAAQqC,SAAS;gBACrB,MAAMuB,aACJvB,AAAyB,UAAzBA,UAAU,KAAK,CAAC,IAAI,GAChB,QACAA,AAAyB,QAAzBA,UAAU,KAAK,CAAC,IAAI,GAClB,OACA;gBACR,MAAMlC,aAAakC,UAAU,KAAK,CAAC,QAAQ,GAAGuB;gBAC9C,MAAM1D,QAAQC,YAAYkC,UAAU,MAAM;gBAC1C,OAAO;oBAAE,SAAS,CAAC,OAAO,EAAElC,WAAW,EAAE,CAAC;gBAAC;YAC7C;QACF;KACD;AACH"}
|
|
1
|
+
{"version":3,"file":"midscene/index.js","sources":["webpack/runtime/define_property_getters","webpack/runtime/has_own_property","webpack/runtime/make_namespace_object","../../../src/node/define-node.ts","../../../src/midscene/index.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 { defineNode as coreDefineNode } from '@midscene/core/internal/test-runner';\nimport type {\n DefineNodeOptions,\n DefineNodeWithSchemaOptions,\n NodeDefinition,\n NodeDefinitionWithSchema,\n NodeInputSchema,\n} from './types';\n\n// A type-only facade: validation and execution still belong to the shared kernel.\ninterface DefineNativeNode {\n <TSchema extends NodeInputSchema, TData = unknown, TContext = unknown>(\n options: DefineNodeWithSchemaOptions<TSchema, TData, TContext>,\n ): NodeDefinitionWithSchema<TSchema, TData, TContext>;\n <TInput = unknown, TData = unknown, TContext = unknown>(\n options: DefineNodeOptions<TInput, TData, TContext>,\n ): NodeDefinition<TInput, TData, TContext>;\n}\nexport const defineNode: DefineNativeNode = coreDefineNode;\n","import type { IExecutionDump } from '@midscene/core';\nimport {\n type AgentTestRunnerNodeDefinition,\n type AgentTestRunnerNodeProvider,\n type CommonAgentTestRunnerApi,\n aiActInputSchema,\n aiActOptionsInputSchema,\n aiAssertInputSchema,\n aiAssertOptionsInputSchema,\n aiTapInputSchema,\n insightInputSchema,\n insightOptionsInputSchema,\n locateOptionsInputSchema,\n promptImageInputSchema,\n recordToReportInputSchema,\n recordToReportOptionsInputSchema,\n reportScreenshotInputSchema,\n structuredUserPromptInputSchema,\n userPromptInputSchema,\n} from '@midscene/core/agent/test';\nimport {\n type WorkflowReportSource,\n admitResourceOperation,\n collectTestRunReportMetrics,\n hasPendingResourceOperation,\n retainResourceForScope,\n trackResourceOperation,\n} from '@midscene/core/internal/test-runner';\nimport {\n enterYamlAction,\n enterYamlExecution,\n runInYamlExecutionContext,\n} from '@midscene/core/internal/yaml-runtime';\nimport { getDebug } from '@midscene/shared/logger';\nimport { z } from 'zod/v4';\nimport type { Awaitable } from '../engine/types';\nimport { NodeDefinitionError } from '../errors';\nimport { defineNode } from '../node/define-node';\nimport type { NodeDefinition, NodeExecutionContext } from '../node/types';\n\nexport type MidsceneUIAgent = CommonAgentTestRunnerApi & {\n _prepareForTestRunner?(): void;\n _createReportSource?(\n scopeId: string,\n executionIds?: readonly string[],\n ): Promise<WorkflowReportSource | undefined>;\n flushReport?(): Promise<string | undefined>;\n addDumpUpdateListener?(\n listener: (dump: string, execution?: MidsceneExecutionRef) => void,\n ): () => void;\n};\n\nexport {\n actionInputSchema,\n aiDragAndDropInputSchema,\n aiInputInputSchema,\n aiKeyboardPressInputSchema,\n aiLongPressInputSchema,\n aiPinchInputSchema,\n aiQueryInputSchema,\n aiScrollInputSchema,\n aiWaitForInputSchema,\n javascriptInputSchema,\n runGherkinScenarioInputSchema,\n setAIContextInputSchema,\n} from '@midscene/core/agent/test';\nexport type {\n ActionNodeInput,\n AiDragAndDropNodeInput,\n AiInputNodeInput,\n AiKeyboardPressNodeInput,\n AiLongPressNodeInput,\n AiPinchNodeInput,\n AiQueryNodeInput,\n AiScrollNodeInput,\n AiWaitForNodeInput,\n JavascriptNodeInput,\n RunGherkinScenarioNodeInput,\n SetAIContextNodeInput,\n} from '@midscene/core/agent/test';\n\nexport {\n aiActInputSchema,\n aiActOptionsInputSchema,\n aiAssertInputSchema,\n aiAssertOptionsInputSchema,\n aiTapInputSchema,\n insightInputSchema,\n insightOptionsInputSchema,\n locateOptionsInputSchema,\n promptImageInputSchema,\n recordToReportInputSchema,\n recordToReportOptionsInputSchema,\n reportScreenshotInputSchema,\n structuredUserPromptInputSchema,\n userPromptInputSchema,\n};\n\nexport interface MidsceneExecutionRef {\n id?: string;\n tasks?: IExecutionDump['tasks'];\n}\n\nexport interface AgentProvider<TContext> {\n getAgent(\n runId: string,\n execution: NodeExecutionContext<unknown, TContext>,\n ): Awaitable<MidsceneUIAgent>;\n // biome-ignore lint/suspicious/noConfusingVoidType: providers without a report intentionally return void.\n releaseAgent?(runId: string): Awaitable<AgentReleaseResult | void>;\n dispose?(): Awaitable<void>;\n}\n\nexport interface AgentReleaseResult {\n /** Absolute path to the finalized report for this Agent scope. */\n reportPath?: string;\n}\n\nexport const waitInputSchema = z.strictObject({\n duration: z.number().positive().describe('How long to wait.'),\n unit: z\n .enum(['ms', 's', 'min'])\n .default('ms')\n .describe('Duration unit: milliseconds, seconds, or minutes.'),\n});\n\nexport type AiActNodeInput = z.infer<typeof aiActInputSchema>;\nexport type AiAssertNodeInput = z.infer<typeof aiAssertInputSchema>;\nexport type AiTapNodeInput = z.infer<typeof aiTapInputSchema>;\nexport type InsightNodeInput = z.infer<typeof insightInputSchema>;\nexport type RecordToReportNodeInput = z.infer<typeof recordToReportInputSchema>;\nexport type WaitNodeInput = z.infer<typeof waitInputSchema>;\n\nexport interface CreateMidsceneNodesOptions<TContext> {\n getAgent?(\n execution: NodeExecutionContext<unknown, TContext>,\n ): Awaitable<MidsceneUIAgent>;\n agentProvider?: AgentProvider<TContext>;\n /** Agent class that declares the Agent-backed Nodes to register. */\n agentClass: AgentTestRunnerNodeProvider;\n}\n\nconst waitFor = async (durationMs: number, signal: AbortSignal) => {\n if (signal.aborted) {\n throw signal.reason ?? new Error('Wait aborted.');\n }\n await new Promise<void>((resolve, reject) => {\n const timeout = setTimeout(() => {\n signal.removeEventListener('abort', abort);\n resolve();\n }, durationMs);\n const abort = () => {\n clearTimeout(timeout);\n reject(signal.reason ?? new Error('Wait aborted.'));\n };\n signal.addEventListener('abort', abort, { once: true });\n });\n};\n\n/** Adapt Agent-owned descriptions to executable Midscene Test Nodes. */\nexport const createAgentTestRunnerNodes = <TContext>(\n definitions: readonly AgentTestRunnerNodeDefinition[],\n getAgent: (\n ctx: NodeExecutionContext<unknown, TContext>,\n ) => Awaitable<unknown>,\n): readonly NodeDefinition<any, any, TContext>[] => {\n const runAgentCall = async <T>(\n node: string,\n ctx: NodeExecutionContext<unknown, TContext>,\n agent: MidsceneUIAgent,\n call: () => Promise<T>,\n captureExecutions = true,\n ): Promise<T> =>\n runInYamlExecutionContext(async () => {\n const scopeId =\n ctx.scope === 'case' ? ctx.case.runId : ctx.document.documentRunId;\n const isCleanupOwner = admitResourceOperation(agent, ctx.signal);\n if (captureExecutions) {\n ctx.report.onSnapshot(async (signal, traces) => {\n signal.throwIfAborted();\n const partial = hasPendingResourceOperation(agent);\n const capturedAt = new Date().toISOString();\n let source = await agent._createReportSource?.(\n scopeId,\n traces.map((trace) => trace.executionId),\n );\n // External adapters may only expose HTML. Capture it independently\n // of cleanup, while marking its mutable source as partial.\n if (!source) {\n const path = await agent.flushReport?.();\n if (path)\n source = {\n sourcePath: path,\n collection: {\n status: 'partial',\n capturedAt,\n reason:\n 'This provider exposes live HTML without immutable snapshot support.',\n },\n };\n }\n signal.throwIfAborted();\n if (!source)\n throw new Error('Agent did not return a report snapshot.');\n return {\n ...source,\n collection: {\n status:\n partial || source.collection?.status === 'partial'\n ? ('partial' as const)\n : ('complete' as const),\n capturedAt: source.collection?.capturedAt ?? capturedAt,\n ...(source.collection?.reason\n ? { reason: source.collection.reason }\n : partial\n ? {\n reason:\n 'An Agent operation was still running at the snapshot cutoff.',\n }\n : {}),\n },\n };\n });\n }\n // Native Steps own the root report. Any Agent.runYaml invoked underneath\n // contributes to that Step instead of publishing another root snapshot.\n const yamlBoundary = enterYamlExecution(agent, {\n allowIndependentOverlap: isCleanupOwner,\n });\n const leaveYamlAction = enterYamlAction(agent, ctx.signal);\n let removeListener: (() => void) | undefined;\n let sawExecutionWithoutId = false;\n const stopListening = () => {\n const remove = removeListener;\n removeListener = undefined;\n remove?.();\n };\n const stopListeningOnAbort = () => stopListening();\n try {\n if (captureExecutions && agent.addDumpUpdateListener) {\n removeListener = agent.addDumpUpdateListener((_dump, execution) => {\n if (!execution) return;\n if (!execution.id) {\n sawExecutionWithoutId = true;\n return;\n }\n ctx.report.addTrace({\n type: 'midscene-execution',\n executionId: execution.id,\n ...(execution.tasks\n ? {\n metrics: collectTestRunReportMetrics({\n executions: [\n {\n id: execution.id,\n name: node,\n logTime: 0,\n tasks: execution.tasks,\n },\n ],\n }),\n }\n : {}),\n });\n });\n if (ctx.signal.aborted) stopListening();\n else {\n ctx.signal.addEventListener('abort', stopListeningOnAbort, {\n once: true,\n });\n }\n }\n return await trackResourceOperation(\n agent,\n Promise.resolve().then(call),\n ctx.signal,\n );\n } finally {\n leaveYamlAction();\n yamlBoundary.finish();\n ctx.signal.removeEventListener('abort', stopListeningOnAbort);\n stopListening();\n if (sawExecutionWithoutId) {\n warnReportTrace(\n `Skipped a report trace without a stable execution id for ${node} in scope ${scopeId}.`,\n );\n }\n }\n });\n\n return definitions.map((definition) =>\n defineNode({\n name: definition.name,\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(ctx) {\n const agent = await getAgent(ctx);\n ctx.signal.throwIfAborted();\n const call = async () =>\n definition.execute(agent, ctx.input, { signal: ctx.signal });\n if (typeof agent !== 'object' || agent === null) return call();\n return runAgentCall(\n definition.name,\n ctx,\n agent as MidsceneUIAgent,\n call,\n );\n },\n }),\n );\n};\n\nconst warnReportTrace = getDebug('test-runner:report-trace', {\n console: true,\n});\n\nexport function createMidsceneNodes<TContext>(\n options: CreateMidsceneNodesOptions<TContext>,\n): readonly NodeDefinition<any, any, TContext>[] {\n if (!options || typeof options !== 'object') {\n throw new NodeDefinitionError(\n 'createMidsceneNodes() options must be an object.',\n );\n }\n if (\n typeof options.agentProvider?.getAgent !== 'function' &&\n typeof options.getAgent !== 'function'\n ) {\n throw new NodeDefinitionError(\n 'createMidsceneNodes() requires getAgent or agentProvider.getAgent.',\n );\n }\n if (\n !options.agentClass ||\n typeof options.agentClass.getTestRunnerNodeDefinitions !== 'function'\n ) {\n throw new NodeDefinitionError(\n 'createMidsceneNodes() requires agentClass.getTestRunnerNodeDefinitions().',\n );\n }\n\n const agentsByScope = new Map<string, Set<MidsceneUIAgent>>();\n const getAgent = async (\n ctx: NodeExecutionContext<unknown, TContext>,\n ): Promise<MidsceneUIAgent> => {\n const runId =\n ctx.scope === 'case' ? ctx.case.runId : ctx.document.documentRunId;\n let agents = agentsByScope.get(runId);\n if (!agents) {\n agents = new Set();\n agentsByScope.set(runId, agents);\n ctx.onTeardown(async () => {\n try {\n const released = await options.agentProvider?.releaseAgent?.(runId);\n return released?.reportPath\n ? { reportPaths: [released.reportPath] }\n : undefined;\n } finally {\n agentsByScope.delete(runId);\n }\n });\n }\n const scopeAgents = agents;\n // Acquisition can outlive cancellation. Teardown waits for actual settlement.\n return trackResourceOperation(\n {},\n Promise.resolve().then(async () => {\n const agent = options.agentProvider\n ? await options.agentProvider.getAgent(runId, ctx)\n : await options.getAgent!(ctx);\n retainResourceForScope(agent, ctx.signal);\n agent._prepareForTestRunner?.();\n scopeAgents.add(agent);\n return agent;\n }),\n ctx.signal,\n 'acquisition',\n );\n };\n\n const agentDefinitions = options.agentClass.getTestRunnerNodeDefinitions();\n\n return [\n ...createAgentTestRunnerNodes(agentDefinitions, getAgent),\n defineNode<typeof waitInputSchema, unknown, TContext>({\n name: 'wait',\n description: 'Wait for a fixed duration while honoring cancellation.',\n stringInputKey: false,\n inputSchema: waitInputSchema,\n async execute(execution) {\n const multiplier =\n execution.input.unit === 'min'\n ? 60_000\n : execution.input.unit === 's'\n ? 1_000\n : 1;\n const durationMs = execution.input.duration * multiplier;\n await waitFor(durationMs, execution.signal);\n return { summary: `Waited ${durationMs}ms` };\n },\n }),\n ];\n}\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","defineNode","coreDefineNode","waitInputSchema","z","waitFor","durationMs","signal","Error","Promise","resolve","reject","timeout","setTimeout","abort","clearTimeout","createAgentTestRunnerNodes","definitions","getAgent","runAgentCall","node","ctx","agent","call","captureExecutions","runInYamlExecutionContext","scopeId","isCleanupOwner","admitResourceOperation","traces","partial","hasPendingResourceOperation","capturedAt","Date","source","trace","path","yamlBoundary","enterYamlExecution","leaveYamlAction","enterYamlAction","removeListener","sawExecutionWithoutId","stopListening","remove","undefined","stopListeningOnAbort","_dump","execution","collectTestRunReportMetrics","trackResourceOperation","warnReportTrace","getDebug","createMidsceneNodes","options","NodeDefinitionError","agentsByScope","Map","runId","agents","Set","released","scopeAgents","retainResourceForScope","agentDefinitions","multiplier"],"mappings":";;;IAAAA,oBAAoB,CAAC,GAAG,CAAC,UAASC;QACjC,IAAI,IAAIC,OAAOD,WACR,IAAGD,oBAAoB,CAAC,CAACC,YAAYC,QAAQ,CAACF,o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