@midscene/web 1.15.3 → 1.15.4-beta-20261013083552.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.
Files changed (135) hide show
  1. package/dist/es/agent-tools-puppeteer.mjs +3 -2
  2. package/dist/es/agent-tools-puppeteer.mjs.map +1 -1
  3. package/dist/es/bridge-mode/io-client.mjs +1 -1
  4. package/dist/es/bridge-mode/io-server.mjs +2 -2
  5. package/dist/es/bridge-mode/io-server.mjs.map +1 -1
  6. package/dist/es/bridge-mode/page-browser-side.mjs +1 -1
  7. package/dist/es/bridge-mode/page-browser-side.mjs.map +1 -1
  8. package/dist/es/cli.mjs +1 -1
  9. package/dist/es/common/persistent-puppeteer-viewport.mjs +27 -0
  10. package/dist/es/common/persistent-puppeteer-viewport.mjs.map +1 -0
  11. package/dist/es/{playwright → common}/test-runner/cookies.mjs +56 -79
  12. package/dist/es/common/test-runner/cookies.mjs.map +1 -0
  13. package/dist/es/common/test-runner/driver.mjs +0 -0
  14. package/dist/es/common/test-runner/nodes.mjs +139 -0
  15. package/dist/es/common/test-runner/nodes.mjs.map +1 -0
  16. package/dist/es/common/test-runner/utils.mjs +24 -0
  17. package/dist/es/common/test-runner/utils.mjs.map +1 -0
  18. package/dist/es/playwright/test-runner/agent-nodes.mjs +3 -10
  19. package/dist/es/playwright/test-runner/agent-nodes.mjs.map +1 -1
  20. package/dist/es/playwright/test-runner/driver.mjs +42 -0
  21. package/dist/es/playwright/test-runner/driver.mjs.map +1 -0
  22. package/dist/es/playwright/test-runner/index.mjs +1 -4
  23. package/dist/es/playwright/test-runner/utils.mjs +1 -21
  24. package/dist/es/playwright/test-runner/utils.mjs.map +1 -1
  25. package/dist/es/puppeteer/browser-agent.mjs +9 -1
  26. package/dist/es/puppeteer/browser-agent.mjs.map +1 -1
  27. package/dist/es/puppeteer/page-agent.mjs +19 -1
  28. package/dist/es/puppeteer/page-agent.mjs.map +1 -1
  29. package/dist/es/puppeteer/test-runner/agent-nodes.mjs +6 -0
  30. package/dist/es/puppeteer/test-runner/agent-nodes.mjs.map +1 -0
  31. package/dist/es/puppeteer/test-runner/driver.mjs +44 -0
  32. package/dist/es/puppeteer/test-runner/driver.mjs.map +1 -0
  33. package/dist/es/puppeteer/test-runner/index.mjs +3 -0
  34. package/dist/es/puppeteer/test-runner/types.mjs +0 -0
  35. package/dist/es/puppeteer/test-runner/utils.mjs +8 -0
  36. package/dist/es/puppeteer/test-runner/utils.mjs.map +1 -0
  37. package/dist/lib/agent-tools-puppeteer.js +3 -2
  38. package/dist/lib/agent-tools-puppeteer.js.map +1 -1
  39. package/dist/lib/bridge-mode/io-client.js +1 -1
  40. package/dist/lib/bridge-mode/io-server.js +2 -2
  41. package/dist/lib/bridge-mode/io-server.js.map +1 -1
  42. package/dist/lib/bridge-mode/page-browser-side.js +1 -1
  43. package/dist/lib/bridge-mode/page-browser-side.js.map +1 -1
  44. package/dist/lib/cli.js +1 -1
  45. package/dist/lib/common/persistent-puppeteer-viewport.js +61 -0
  46. package/dist/lib/common/persistent-puppeteer-viewport.js.map +1 -0
  47. package/dist/lib/{playwright → common}/test-runner/cookies.js +58 -81
  48. package/dist/lib/common/test-runner/cookies.js.map +1 -0
  49. package/dist/lib/common/test-runner/driver.js +20 -0
  50. package/dist/lib/common/test-runner/driver.js.map +1 -0
  51. package/dist/lib/common/test-runner/nodes.js +185 -0
  52. package/dist/lib/common/test-runner/nodes.js.map +1 -0
  53. package/dist/lib/common/test-runner/utils.js +61 -0
  54. package/dist/lib/common/test-runner/utils.js.map +1 -0
  55. package/dist/lib/playwright/test-runner/agent-nodes.js +3 -10
  56. package/dist/lib/playwright/test-runner/agent-nodes.js.map +1 -1
  57. package/dist/lib/playwright/test-runner/driver.js +76 -0
  58. package/dist/lib/playwright/test-runner/driver.js.map +1 -0
  59. package/dist/lib/playwright/test-runner/index.js +5 -8
  60. package/dist/lib/playwright/test-runner/utils.js +4 -24
  61. package/dist/lib/playwright/test-runner/utils.js.map +1 -1
  62. package/dist/lib/puppeteer/browser-agent.js +9 -1
  63. package/dist/lib/puppeteer/browser-agent.js.map +1 -1
  64. package/dist/lib/puppeteer/page-agent.js +19 -1
  65. package/dist/lib/puppeteer/page-agent.js.map +1 -1
  66. package/dist/lib/puppeteer/test-runner/agent-nodes.js +40 -0
  67. package/dist/lib/puppeteer/test-runner/agent-nodes.js.map +1 -0
  68. package/dist/lib/puppeteer/test-runner/driver.js +78 -0
  69. package/dist/lib/puppeteer/test-runner/driver.js.map +1 -0
  70. package/dist/lib/puppeteer/test-runner/index.js +51 -0
  71. package/dist/lib/puppeteer/test-runner/index.js.map +1 -0
  72. package/dist/lib/puppeteer/test-runner/types.js +20 -0
  73. package/dist/lib/puppeteer/test-runner/types.js.map +1 -0
  74. package/dist/lib/puppeteer/test-runner/utils.js +48 -0
  75. package/dist/lib/puppeteer/test-runner/utils.js.map +1 -0
  76. package/dist/types/agent-tools-puppeteer.d.ts.map +1 -1
  77. package/dist/types/common/persistent-puppeteer-viewport.d.ts +5 -0
  78. package/dist/types/common/persistent-puppeteer-viewport.d.ts.map +1 -0
  79. package/dist/types/common/test-runner/cookies.d.ts +52 -0
  80. package/dist/types/common/test-runner/cookies.d.ts.map +1 -0
  81. package/dist/types/common/test-runner/driver.d.ts +38 -0
  82. package/dist/types/common/test-runner/driver.d.ts.map +1 -0
  83. package/dist/types/common/test-runner/nodes.d.ts +38 -0
  84. package/dist/types/common/test-runner/nodes.d.ts.map +1 -0
  85. package/dist/types/common/test-runner/utils.d.ts +3 -0
  86. package/dist/types/common/test-runner/utils.d.ts.map +1 -0
  87. package/dist/types/playwright/test-runner/agent-nodes.d.ts +1 -2
  88. package/dist/types/playwright/test-runner/agent-nodes.d.ts.map +1 -1
  89. package/dist/types/playwright/test-runner/driver.d.ts +4 -0
  90. package/dist/types/playwright/test-runner/driver.d.ts.map +1 -0
  91. package/dist/types/playwright/test-runner/index.d.ts +2 -8
  92. package/dist/types/playwright/test-runner/index.d.ts.map +1 -1
  93. package/dist/types/playwright/test-runner/types.d.ts +5 -14
  94. package/dist/types/playwright/test-runner/types.d.ts.map +1 -1
  95. package/dist/types/playwright/test-runner/utils.d.ts +1 -2
  96. package/dist/types/playwright/test-runner/utils.d.ts.map +1 -1
  97. package/dist/types/puppeteer/browser-agent.d.ts +5 -0
  98. package/dist/types/puppeteer/browser-agent.d.ts.map +1 -1
  99. package/dist/types/puppeteer/index.d.ts +1 -1
  100. package/dist/types/puppeteer/index.d.ts.map +1 -1
  101. package/dist/types/puppeteer/page-agent.d.ts +8 -1
  102. package/dist/types/puppeteer/page-agent.d.ts.map +1 -1
  103. package/dist/types/puppeteer/test-runner/agent-nodes.d.ts +2 -0
  104. package/dist/types/puppeteer/test-runner/agent-nodes.d.ts.map +1 -0
  105. package/dist/types/puppeteer/test-runner/driver.d.ts +4 -0
  106. package/dist/types/puppeteer/test-runner/driver.d.ts.map +1 -0
  107. package/dist/types/puppeteer/test-runner/index.d.ts +5 -0
  108. package/dist/types/puppeteer/test-runner/index.d.ts.map +1 -0
  109. package/dist/types/puppeteer/test-runner/types.d.ts +18 -0
  110. package/dist/types/puppeteer/test-runner/types.d.ts.map +1 -0
  111. package/dist/types/puppeteer/test-runner/utils.d.ts +4 -0
  112. package/dist/types/puppeteer/test-runner/utils.d.ts.map +1 -0
  113. package/package.json +9 -4
  114. package/dist/es/playwright/test-runner/clear-cookies.mjs +0 -45
  115. package/dist/es/playwright/test-runner/clear-cookies.mjs.map +0 -1
  116. package/dist/es/playwright/test-runner/cookies.mjs.map +0 -1
  117. package/dist/es/playwright/test-runner/goto-url.mjs +0 -60
  118. package/dist/es/playwright/test-runner/goto-url.mjs.map +0 -1
  119. package/dist/es/playwright/test-runner/viewport.mjs +0 -35
  120. package/dist/es/playwright/test-runner/viewport.mjs.map +0 -1
  121. package/dist/lib/playwright/test-runner/clear-cookies.js +0 -82
  122. package/dist/lib/playwright/test-runner/clear-cookies.js.map +0 -1
  123. package/dist/lib/playwright/test-runner/cookies.js.map +0 -1
  124. package/dist/lib/playwright/test-runner/goto-url.js +0 -97
  125. package/dist/lib/playwright/test-runner/goto-url.js.map +0 -1
  126. package/dist/lib/playwright/test-runner/viewport.js +0 -72
  127. package/dist/lib/playwright/test-runner/viewport.js.map +0 -1
  128. package/dist/types/playwright/test-runner/clear-cookies.d.ts +0 -17
  129. package/dist/types/playwright/test-runner/clear-cookies.d.ts.map +0 -1
  130. package/dist/types/playwright/test-runner/cookies.d.ts +0 -33
  131. package/dist/types/playwright/test-runner/cookies.d.ts.map +0 -1
  132. package/dist/types/playwright/test-runner/goto-url.d.ts +0 -26
  133. package/dist/types/playwright/test-runner/goto-url.d.ts.map +0 -1
  134. package/dist/types/playwright/test-runner/viewport.d.ts +0 -14
  135. package/dist/types/playwright/test-runner/viewport.d.ts.map +0 -1
@@ -1,82 +0,0 @@
1
- "use strict";
2
- var __webpack_require__ = {};
3
- (()=>{
4
- __webpack_require__.d = (exports1, definition)=>{
5
- for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
- enumerable: true,
7
- get: definition[key]
8
- });
9
- };
10
- })();
11
- (()=>{
12
- __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
- })();
14
- (()=>{
15
- __webpack_require__.r = (exports1)=>{
16
- if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
- value: 'Module'
18
- });
19
- Object.defineProperty(exports1, '__esModule', {
20
- value: true
21
- });
22
- };
23
- })();
24
- var __webpack_exports__ = {};
25
- __webpack_require__.r(__webpack_exports__);
26
- __webpack_require__.d(__webpack_exports__, {
27
- clearCookiesInputSchema: ()=>clearCookiesInputSchema,
28
- clearCookiesNode: ()=>clearCookiesNode
29
- });
30
- const v4_namespaceObject = require("zod/v4");
31
- const external_utils_js_namespaceObject = require("./utils.js");
32
- const clearCookiesInputSchema = v4_namespaceObject.z.strictObject({
33
- name: v4_namespaceObject.z.string().regex(/\S/).optional().describe('Cookie name to clear.'),
34
- domain: v4_namespaceObject.z.string().regex(/\S/).optional().describe('Cookie domain to clear.'),
35
- path: v4_namespaceObject.z.string().regex(/\S/).optional().describe('Cookie path to clear.')
36
- });
37
- const clearCookiesNode = {
38
- name: 'clearCookies',
39
- title: 'Clear browser cookies',
40
- description: 'Clear all cookies from the current Playwright BrowserContext, or only cookies matching name, domain, or path.',
41
- stringInputKey: false,
42
- inputSchema: clearCookiesInputSchema,
43
- async execute (agent, input, executionContext) {
44
- const ctx = {
45
- ...executionContext,
46
- input,
47
- context: (0, external_utils_js_namespaceObject.requirePlaywrightAgent)(agent)
48
- };
49
- (0, external_utils_js_namespaceObject.throwIfAborted)(ctx.signal, 'clearCookies');
50
- const page = ctx.context.interface.underlyingPage;
51
- const filters = {
52
- ...void 0 === ctx.input.name ? {} : {
53
- name: ctx.input.name
54
- },
55
- ...void 0 === ctx.input.domain ? {} : {
56
- domain: ctx.input.domain
57
- },
58
- ...void 0 === ctx.input.path ? {} : {
59
- path: ctx.input.path
60
- }
61
- };
62
- await page.context().clearCookies(filters);
63
- const filterNames = Object.keys(filters);
64
- return {
65
- summary: 0 === filterNames.length ? 'Cleared all browser cookies' : `Cleared browser cookies matching ${filterNames.join(', ')}`,
66
- data: {
67
- filters
68
- }
69
- };
70
- }
71
- };
72
- exports.clearCookiesInputSchema = __webpack_exports__.clearCookiesInputSchema;
73
- exports.clearCookiesNode = __webpack_exports__.clearCookiesNode;
74
- for(var __rspack_i in __webpack_exports__)if (-1 === [
75
- "clearCookiesInputSchema",
76
- "clearCookiesNode"
77
- ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
78
- Object.defineProperty(exports, '__esModule', {
79
- value: true
80
- });
81
-
82
- //# sourceMappingURL=clear-cookies.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"playwright/test-runner/clear-cookies.js","sources":["webpack/runtime/define_property_getters","webpack/runtime/has_own_property","webpack/runtime/make_namespace_object","../../../../src/playwright/test-runner/clear-cookies.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 type { AgentTestRunnerNodeDefinition } from '@midscene/core/agent';\nimport type { BrowserContext } from 'playwright';\nimport { z } from 'zod/v4';\nimport { requirePlaywrightAgent, throwIfAborted } from './utils';\n\ntype CookieClearOptions = NonNullable<\n Parameters<BrowserContext['clearCookies']>[0]\n>;\n\n/** Input schema for the Playwright clearCookies Node. */\nexport const clearCookiesInputSchema = z.strictObject({\n name: z.string().regex(/\\S/).optional().describe('Cookie name to clear.'),\n domain: z.string().regex(/\\S/).optional().describe('Cookie domain to clear.'),\n path: z.string().regex(/\\S/).optional().describe('Cookie path to clear.'),\n});\n\n/** Validated input accepted by the Playwright clearCookies Node. */\nexport type ClearCookiesNodeInput = z.infer<typeof clearCookiesInputSchema>;\n\nexport const clearCookiesNode: AgentTestRunnerNodeDefinition<\n z.output<typeof clearCookiesInputSchema>,\n { filters: CookieClearOptions }\n> = {\n name: 'clearCookies',\n title: 'Clear browser cookies',\n description:\n 'Clear all cookies from the current Playwright BrowserContext, or only cookies matching name, domain, or path.',\n stringInputKey: false,\n inputSchema: clearCookiesInputSchema,\n async execute(agent, input, executionContext) {\n const ctx = {\n ...executionContext,\n input,\n context: requirePlaywrightAgent(agent),\n };\n throwIfAborted(ctx.signal, 'clearCookies');\n const page = ctx.context.interface.underlyingPage;\n const filters: CookieClearOptions = {\n ...(ctx.input.name === undefined ? {} : { name: ctx.input.name }),\n ...(ctx.input.domain === undefined ? {} : { domain: ctx.input.domain }),\n ...(ctx.input.path === undefined ? {} : { path: ctx.input.path }),\n };\n await page.context().clearCookies(filters);\n const filterNames = Object.keys(filters);\n return {\n summary:\n filterNames.length === 0\n ? 'Cleared all browser cookies'\n : `Cleared browser cookies matching ${filterNames.join(', ')}`,\n data: { filters },\n };\n },\n};\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","clearCookiesInputSchema","z","clearCookiesNode","agent","input","executionContext","ctx","requirePlaywrightAgent","throwIfAborted","page","filters","undefined","filterNames"],"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;;;;;;;;;;ACIO,MAAMI,0BAA0BC,mBAAAA,CAAAA,CAAAA,YAAc,CAAC;IACpD,MAAMA,mBAAAA,CAAAA,CAAAA,MAAQ,GAAG,KAAK,CAAC,MAAM,QAAQ,GAAG,QAAQ,CAAC;IACjD,QAAQA,mBAAAA,CAAAA,CAAAA,MAAQ,GAAG,KAAK,CAAC,MAAM,QAAQ,GAAG,QAAQ,CAAC;IACnD,MAAMA,mBAAAA,CAAAA,CAAAA,MAAQ,GAAG,KAAK,CAAC,MAAM,QAAQ,GAAG,QAAQ,CAAC;AACnD;AAKO,MAAMC,mBAGT;IACF,MAAM;IACN,OAAO;IACP,aACE;IACF,gBAAgB;IAChB,aAAaF;IACb,MAAM,SAAQG,KAAK,EAAEC,KAAK,EAAEC,gBAAgB;QAC1C,MAAMC,MAAM;YACV,GAAGD,gBAAgB;YACnBD;YACA,SAASG,AAAAA,IAAAA,kCAAAA,sBAAAA,AAAAA,EAAuBJ;QAClC;QACAK,IAAAA,kCAAAA,cAAAA,AAAAA,EAAeF,IAAI,MAAM,EAAE;QAC3B,MAAMG,OAAOH,IAAI,OAAO,CAAC,SAAS,CAAC,cAAc;QACjD,MAAMI,UAA8B;YAClC,GAAIJ,AAAmBK,WAAnBL,IAAI,KAAK,CAAC,IAAI,GAAiB,CAAC,IAAI;gBAAE,MAAMA,IAAI,KAAK,CAAC,IAAI;YAAC,CAAC;YAChE,GAAIA,AAAqBK,WAArBL,IAAI,KAAK,CAAC,MAAM,GAAiB,CAAC,IAAI;gBAAE,QAAQA,IAAI,KAAK,CAAC,MAAM;YAAC,CAAC;YACtE,GAAIA,AAAmBK,WAAnBL,IAAI,KAAK,CAAC,IAAI,GAAiB,CAAC,IAAI;gBAAE,MAAMA,IAAI,KAAK,CAAC,IAAI;YAAC,CAAC;QAClE;QACA,MAAMG,KAAK,OAAO,GAAG,YAAY,CAACC;QAClC,MAAME,cAAchB,OAAO,IAAI,CAACc;QAChC,OAAO;YACL,SACEE,AAAuB,MAAvBA,YAAY,MAAM,GACd,gCACA,CAAC,iCAAiC,EAAEA,YAAY,IAAI,CAAC,OAAO;YAClE,MAAM;gBAAEF;YAAQ;QAClB;IACF;AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"playwright/test-runner/cookies.js","sources":["webpack/runtime/define_property_getters","webpack/runtime/has_own_property","webpack/runtime/make_namespace_object","../../../../src/playwright/test-runner/cookies.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 { readFile } from 'node:fs/promises';\nimport { resolve } from 'node:path';\nimport type { AgentTestRunnerNodeDefinition } from '@midscene/core/agent';\nimport { z } from 'zod/v4';\nimport type {\n PlaywrightCookie,\n PlaywrightNodeContext,\n PlaywrightTestRunnerAgent,\n PlaywrightTestRunnerOptions,\n} from './types';\nimport { requirePlaywrightAgent, resolveWebUrl, throwIfAborted } from './utils';\n\ntype CookieSourceReference =\n | { kind: 'env'; name: string }\n | { kind: 'profile'; name: string }\n | { kind: 'storage-state'; name: string };\n\ninterface ResolvedCookieSource {\n reference: CookieSourceReference;\n cookies: unknown;\n}\n\n/** Input schema for the Playwright setCookies Node. */\nexport const setCookiesInputSchema = z\n .strictObject({\n cookiesEnv: z\n .string()\n .regex(/^[A-Za-z_][A-Za-z0-9_]*$/)\n .optional()\n .describe(\n 'The environment variable containing a Cookie header, cookie array JSON, or Playwright storage-state JSON.',\n ),\n profile: z\n .string()\n .regex(/\\S/)\n .optional()\n .describe('A cookie profile resolved by getCookieProfile().'),\n storageStatePath: z\n .string()\n .regex(/\\S/)\n .optional()\n .describe('A path to a Playwright storage-state JSON file.'),\n url: z\n .string()\n .url()\n .optional()\n .describe(\n 'The HTTP(S) URL used to scope Cookie-header values or cookies without domain/path.',\n ),\n })\n .superRefine((input, ctx) => {\n const sourceCount = [\n input.cookiesEnv,\n input.profile,\n input.storageStatePath,\n ].filter((value) => value !== undefined).length;\n if (sourceCount !== 1) {\n ctx.addIssue({\n code: 'custom',\n message:\n 'exactly one of cookiesEnv, profile, and storageStatePath is required',\n });\n }\n });\n\n/** Validated input accepted by the Playwright setCookies Node. */\nexport type SetCookiesNodeInput = z.infer<typeof setCookiesInputSchema>;\n\n/** Secret-free metadata returned by the Playwright setCookies Node. */\nexport interface SetCookiesNodeResult {\n /** Kind of configured reference used to resolve the cookies. */\n source: CookieSourceReference['kind'];\n /** Environment variable, profile, or storage-state reference name. */\n sourceName: string;\n /** Number of cookies passed to the BrowserContext. */\n count: number;\n}\n\nconst toCookieSourceReference = (\n input: SetCookiesNodeInput,\n): CookieSourceReference => {\n if (input.cookiesEnv !== undefined) {\n return { kind: 'env', name: input.cookiesEnv };\n }\n if (input.profile !== undefined) {\n return { kind: 'profile', name: input.profile };\n }\n if (input.storageStatePath !== undefined) {\n return { kind: 'storage-state', name: input.storageStatePath };\n }\n throw new TypeError('setCookies requires one cookie source.');\n};\n\nconst parseCookieHeader = (raw: string, url: string | undefined) => {\n if (url === undefined) {\n throw new TypeError(\n 'setCookies.url is required when cookiesEnv contains a Cookie header.',\n );\n }\n const segments = raw\n .split(';')\n .map((segment) => segment.trim())\n .filter(Boolean);\n if (segments.length === 0) {\n throw new TypeError('setCookies Cookie header contains no cookies.');\n }\n return segments.map((segment) => {\n const separator = segment.indexOf('=');\n if (separator <= 0) {\n throw new TypeError(\n 'setCookies Cookie header contains an invalid name/value pair.',\n );\n }\n const name = segment.slice(0, separator).trim();\n const value = segment.slice(separator + 1).trim();\n if (!name) {\n throw new TypeError('setCookies Cookie header contains an empty name.');\n }\n return { name, value, url } satisfies PlaywrightCookie;\n });\n};\n\nconst parseCookieJson = (raw: string): unknown => {\n try {\n return JSON.parse(raw);\n } catch {\n throw new TypeError(\n 'setCookies source must contain valid JSON or a Cookie header.',\n );\n }\n};\n\nconst resolveCookieSource = async (\n reference: CookieSourceReference,\n defaultUrl: string | undefined,\n ctx: PlaywrightNodeContext<PlaywrightTestRunnerAgent>,\n options: PlaywrightTestRunnerOptions,\n): Promise<ResolvedCookieSource> => {\n switch (reference.kind) {\n case 'env': {\n let env: Readonly<Record<string, string | undefined>>;\n try {\n env = (await options.getEnv?.(ctx)) ?? process.env;\n } catch {\n throw new Error(\n `Failed to resolve cookie environment ${reference.name}; the original error was redacted because it may contain cookie values.`,\n );\n }\n const raw = env[reference.name];\n if (!raw?.trim()) {\n throw new Error(\n `Environment variable ${reference.name} is missing or blank.`,\n );\n }\n const trimmed = raw.trim();\n return {\n reference,\n cookies: /^[\\[{]/.test(trimmed)\n ? parseCookieJson(trimmed)\n : parseCookieHeader(trimmed, defaultUrl),\n };\n }\n case 'profile': {\n if (!options.getCookieProfile) {\n throw new Error(\n 'setCookies.profile requires a configured getCookieProfile callback.',\n );\n }\n try {\n return {\n reference,\n cookies: await options.getCookieProfile({\n profile: reference.name,\n context: ctx.context,\n signal: ctx.signal,\n }),\n };\n } catch {\n throw new Error(\n `Failed to resolve cookie profile ${reference.name}; the original error was redacted because it may contain cookie values.`,\n );\n }\n }\n case 'storage-state': {\n const path = options.resolveStorageStatePath\n ? await options.resolveStorageStatePath(reference.name, ctx)\n : resolve(process.cwd(), reference.name);\n return {\n reference,\n cookies: parseCookieJson(await readFile(path, 'utf8')),\n };\n }\n }\n};\n\nconst normalizeCookie = (\n candidate: unknown,\n defaultUrl: string | undefined,\n index: number,\n): PlaywrightCookie => {\n if (!candidate || typeof candidate !== 'object' || Array.isArray(candidate)) {\n throw new TypeError(\n `setCookies cookie at index ${index} must be an object.`,\n );\n }\n const cookie = candidate as Record<string, unknown>;\n if (typeof cookie.name !== 'string' || !cookie.name.trim()) {\n throw new TypeError(\n `setCookies cookie at index ${index} requires a non-blank name.`,\n );\n }\n if (typeof cookie.value !== 'string') {\n throw new TypeError(\n `setCookies cookie at index ${index} requires a string value.`,\n );\n }\n\n const normalized = { ...cookie } as unknown as PlaywrightCookie;\n const hasUrl = typeof cookie.url === 'string' && cookie.url.length > 0;\n const hasDomain =\n typeof cookie.domain === 'string' && cookie.domain.length > 0;\n if (!hasUrl && !hasDomain) {\n if (defaultUrl === undefined) {\n throw new TypeError(\n `setCookies cookie at index ${index} requires url or domain, or setCookies.url must be provided.`,\n );\n }\n normalized.url = defaultUrl;\n }\n if (hasDomain && typeof cookie.path !== 'string') {\n normalized.path = '/';\n }\n return normalized;\n};\n\nconst normalizeCookies = (\n source: unknown,\n defaultUrl: string | undefined,\n): PlaywrightCookie[] => {\n const candidates = Array.isArray(source)\n ? source\n : source &&\n typeof source === 'object' &&\n Array.isArray((source as { cookies?: unknown }).cookies)\n ? (source as { cookies: unknown[] }).cookies\n : undefined;\n if (!candidates) {\n throw new TypeError(\n 'setCookies JSON must be a cookie array or an object with a cookies array.',\n );\n }\n if (candidates.length === 0) {\n throw new TypeError('setCookies source contains no cookies.');\n }\n return candidates.map((cookie, index) =>\n normalizeCookie(cookie, defaultUrl, index),\n );\n};\n\nexport const setCookiesNode: AgentTestRunnerNodeDefinition<\n z.output<typeof setCookiesInputSchema>,\n SetCookiesNodeResult\n> = {\n name: 'setCookies',\n title: 'Set browser cookies',\n description:\n 'Load cookies from an environment variable, configured profile, or Playwright storage-state file without persisting cookie values in workflow input or output.',\n stringInputKey: false,\n inputSchema: setCookiesInputSchema,\n async execute(agent, input, executionContext) {\n const ctx = {\n ...executionContext,\n input,\n context: requirePlaywrightAgent(agent),\n };\n throwIfAborted(ctx.signal, 'setCookies');\n const page = ctx.context.interface.underlyingPage;\n const defaultUrl =\n ctx.input.url === undefined\n ? undefined\n : resolveWebUrl(ctx.input.url, undefined, 'setCookies.url');\n const reference = toCookieSourceReference(ctx.input);\n const resolved = await resolveCookieSource(\n reference,\n defaultUrl,\n ctx,\n ctx.context.testRunner ?? {},\n );\n const cookies = normalizeCookies(resolved.cookies, defaultUrl);\n\n throwIfAborted(ctx.signal, 'setCookies');\n try {\n await page.context().addCookies(cookies);\n } catch {\n throw new Error(\n `Failed to set ${cookies.length} browser cookie(s); the browser error was redacted because it may contain cookie values.`,\n );\n }\n\n const result: SetCookiesNodeResult = {\n source: resolved.reference.kind,\n sourceName: resolved.reference.name,\n count: cookies.length,\n };\n return {\n summary: `Set ${result.count} browser cookie(s) from ${result.source} source ${result.sourceName}`,\n data: result,\n };\n },\n};\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","setCookiesInputSchema","z","input","ctx","sourceCount","value","undefined","toCookieSourceReference","TypeError","parseCookieHeader","raw","url","segments","segment","Boolean","separator","name","parseCookieJson","JSON","resolveCookieSource","reference","defaultUrl","options","env","process","Error","trimmed","path","resolve","readFile","normalizeCookie","candidate","index","Array","cookie","normalized","hasUrl","hasDomain","normalizeCookies","source","candidates","setCookiesNode","agent","executionContext","requirePlaywrightAgent","throwIfAborted","page","resolveWebUrl","resolved","cookies","result"],"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;;;;;;;;;;;;ACiBO,MAAMI,wBAAwBC,mBAAAA,CAAAA,CAAAA,YACtB,CAAC;IACZ,YAAYA,mBAAAA,CAAAA,CAAAA,MACH,GACN,KAAK,CAAC,4BACN,QAAQ,GACR,QAAQ,CACP;IAEJ,SAASA,mBAAAA,CAAAA,CAAAA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M,EAAE;QAC3B,IAAI;YACF,MAAM2C,KAAK,OAAO,GAAG,UAAU,CAACG;QAClC,EAAE,OAAM;YACN,MAAM,IAAIxB,MACR,CAAC,cAAc,EAAEwB,QAAQ,MAAM,CAAC,wFAAwF,CAAC;QAE7H;QAEA,MAAMC,SAA+B;YACnC,QAAQF,SAAS,SAAS,CAAC,IAAI;YAC/B,YAAYA,SAAS,SAAS,CAAC,IAAI;YACnC,OAAOC,QAAQ,MAAM;QACvB;QACA,OAAO;YACL,SAAS,CAAC,IAAI,EAAEC,OAAO,KAAK,CAAC,wBAAwB,EAAEA,OAAO,MAAM,CAAC,QAAQ,EAAEA,OAAO,UAAU,EAAE;YAClG,MAAMA;QACR;IACF;AACF"}
@@ -1,97 +0,0 @@
1
- "use strict";
2
- var __webpack_require__ = {};
3
- (()=>{
4
- __webpack_require__.d = (exports1, definition)=>{
5
- for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
- enumerable: true,
7
- get: definition[key]
8
- });
9
- };
10
- })();
11
- (()=>{
12
- __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
- })();
14
- (()=>{
15
- __webpack_require__.r = (exports1)=>{
16
- if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
- value: 'Module'
18
- });
19
- Object.defineProperty(exports1, '__esModule', {
20
- value: true
21
- });
22
- };
23
- })();
24
- var __webpack_exports__ = {};
25
- __webpack_require__.r(__webpack_exports__);
26
- __webpack_require__.d(__webpack_exports__, {
27
- gotoUrlInputSchema: ()=>gotoUrlInputSchema,
28
- gotoUrlNode: ()=>gotoUrlNode
29
- });
30
- const v4_namespaceObject = require("zod/v4");
31
- const external_utils_js_namespaceObject = require("./utils.js");
32
- const DEFAULT_NAVIGATION_TIMEOUT_MS = 60000;
33
- const DEFAULT_WAIT_UNTIL = 'domcontentloaded';
34
- const gotoUrlInputSchema = v4_namespaceObject.z.strictObject({
35
- url: v4_namespaceObject.z.string().min(1).describe('An absolute HTTP(S) URL or a path relative to Playwright baseURL or the current page URL.'),
36
- waitUntil: v4_namespaceObject.z["enum"]([
37
- 'commit',
38
- 'domcontentloaded',
39
- 'load',
40
- 'networkidle'
41
- ]).default(DEFAULT_WAIT_UNTIL).describe('The Playwright navigation lifecycle event to wait for.'),
42
- timeoutMs: v4_namespaceObject.z.number().positive().default(DEFAULT_NAVIGATION_TIMEOUT_MS).describe('The navigation timeout in milliseconds.')
43
- });
44
- const resolveNavigationUrl = (target, page)=>{
45
- const trimmed = target.trim();
46
- if (!trimmed) throw new TypeError('gotoUrl.url must not be blank.');
47
- if (/^[a-z][a-z\d+.-]*:/i.test(trimmed)) return (0, external_utils_js_namespaceObject.resolveWebUrl)(trimmed, void 0, 'gotoUrl.url');
48
- const context = page.context();
49
- const configuredBase = context._options?.baseURL;
50
- if (void 0 !== configuredBase) return (0, external_utils_js_namespaceObject.resolveWebUrl)(trimmed, configuredBase, 'gotoUrl.url');
51
- const currentUrl = page.url();
52
- if (!/^https?:\/\//i.test(currentUrl)) throw new TypeError(`gotoUrl.url cannot resolve a relative URL from ${JSON.stringify(currentUrl)}. Use an absolute HTTP(S) URL for the first navigation or configure Playwright baseURL.`);
53
- return (0, external_utils_js_namespaceObject.resolveWebUrl)(trimmed, currentUrl, 'gotoUrl.url');
54
- };
55
- const gotoUrlNode = {
56
- name: 'gotoUrl',
57
- title: 'Open a Web URL',
58
- description: 'Navigate the current Playwright Page to an absolute HTTP(S) URL or a path relative to Playwright baseURL or the current page URL.',
59
- stringInputKey: 'url',
60
- inputSchema: gotoUrlInputSchema,
61
- async execute (agent, input, executionContext) {
62
- const ctx = {
63
- ...executionContext,
64
- input,
65
- context: (0, external_utils_js_namespaceObject.requirePlaywrightAgent)(agent)
66
- };
67
- (0, external_utils_js_namespaceObject.throwIfAborted)(ctx.signal, 'gotoUrl');
68
- const page = ctx.context.interface.underlyingPage;
69
- const url = resolveNavigationUrl(ctx.input.url, page);
70
- const response = await page.goto(url, {
71
- waitUntil: ctx.input.waitUntil,
72
- timeout: ctx.input.timeoutMs
73
- });
74
- (0, external_utils_js_namespaceObject.throwIfAborted)(ctx.signal, 'gotoUrl');
75
- const status = response?.status() ?? null;
76
- const result = {
77
- url: page.url(),
78
- status,
79
- title: await page.title()
80
- };
81
- return {
82
- summary: `Navigated to ${result.url}`,
83
- data: result
84
- };
85
- }
86
- };
87
- exports.gotoUrlInputSchema = __webpack_exports__.gotoUrlInputSchema;
88
- exports.gotoUrlNode = __webpack_exports__.gotoUrlNode;
89
- for(var __rspack_i in __webpack_exports__)if (-1 === [
90
- "gotoUrlInputSchema",
91
- "gotoUrlNode"
92
- ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
93
- Object.defineProperty(exports, '__esModule', {
94
- value: true
95
- });
96
-
97
- //# sourceMappingURL=goto-url.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"playwright/test-runner/goto-url.js","sources":["webpack/runtime/define_property_getters","webpack/runtime/has_own_property","webpack/runtime/make_namespace_object","../../../../src/playwright/test-runner/goto-url.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 type { AgentTestRunnerNodeDefinition } from '@midscene/core/agent';\nimport type { BrowserContext, Page } from 'playwright';\nimport { z } from 'zod/v4';\nimport { requirePlaywrightAgent, resolveWebUrl, throwIfAborted } from './utils';\n\nconst DEFAULT_NAVIGATION_TIMEOUT_MS = 60_000;\nconst DEFAULT_WAIT_UNTIL = 'domcontentloaded' as const;\n\n/** Input schema for the Playwright gotoUrl Node. */\nexport const gotoUrlInputSchema = z.strictObject({\n url: z\n .string()\n .min(1)\n .describe(\n 'An absolute HTTP(S) URL or a path relative to Playwright baseURL or the current page URL.',\n ),\n waitUntil: z\n .enum(['commit', 'domcontentloaded', 'load', 'networkidle'])\n .default(DEFAULT_WAIT_UNTIL)\n .describe('The Playwright navigation lifecycle event to wait for.'),\n timeoutMs: z\n .number()\n .positive()\n .default(DEFAULT_NAVIGATION_TIMEOUT_MS)\n .describe('The navigation timeout in milliseconds.'),\n});\n\n/** Validated input accepted by the Playwright gotoUrl Node. */\nexport type GotoUrlNodeInput = z.infer<typeof gotoUrlInputSchema>;\n\n/** Structured navigation details returned by the Playwright gotoUrl Node. */\nexport interface GotoUrlNodeResult {\n /** Final Page URL after navigation and redirects. */\n url: string;\n /** Main-resource HTTP status, or null when Playwright returns no response. */\n status: number | null;\n /** Document title after navigation completes. */\n title: string;\n}\n\nconst resolveNavigationUrl = (target: string, page: Page): string => {\n const trimmed = target.trim();\n if (!trimmed) throw new TypeError('gotoUrl.url must not be blank.');\n // Absolute URLs do not depend on either configured or current-page bases.\n if (/^[a-z][a-z\\d+.-]*:/i.test(trimmed)) {\n return resolveWebUrl(trimmed, undefined, 'gotoUrl.url');\n }\n\n // Playwright has no public baseURL getter. Its BrowserContext stores the\n // configured value in _options; keep this internal access localized here.\n const context = page.context() as BrowserContext & {\n _options?: { baseURL?: string };\n };\n const configuredBase = context._options?.baseURL;\n if (configuredBase !== undefined) {\n return resolveWebUrl(trimmed, configuredBase, 'gotoUrl.url');\n }\n\n const currentUrl = page.url();\n if (!/^https?:\\/\\//i.test(currentUrl)) {\n throw new TypeError(\n `gotoUrl.url cannot resolve a relative URL from ${JSON.stringify(currentUrl)}. Use an absolute HTTP(S) URL for the first navigation or configure Playwright baseURL.`,\n );\n }\n return resolveWebUrl(trimmed, currentUrl, 'gotoUrl.url');\n};\n\nexport const gotoUrlNode: AgentTestRunnerNodeDefinition<\n z.output<typeof gotoUrlInputSchema>,\n GotoUrlNodeResult\n> = {\n name: 'gotoUrl',\n title: 'Open a Web URL',\n description:\n 'Navigate the current Playwright Page to an absolute HTTP(S) URL or a path relative to Playwright baseURL or the current page URL.',\n stringInputKey: 'url',\n inputSchema: gotoUrlInputSchema,\n async execute(agent, input, executionContext) {\n const ctx = {\n ...executionContext,\n input,\n context: requirePlaywrightAgent(agent),\n };\n throwIfAborted(ctx.signal, 'gotoUrl');\n const page = ctx.context.interface.underlyingPage;\n const url = resolveNavigationUrl(ctx.input.url, page);\n const response = await page.goto(url, {\n waitUntil: ctx.input.waitUntil,\n timeout: ctx.input.timeoutMs,\n });\n throwIfAborted(ctx.signal, 'gotoUrl');\n const status = response?.status() ?? null;\n const result = {\n url: page.url(),\n status,\n title: await page.title(),\n };\n return { summary: `Navigated to ${result.url}`, data: result };\n },\n};\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","DEFAULT_NAVIGATION_TIMEOUT_MS","DEFAULT_WAIT_UNTIL","gotoUrlInputSchema","z","resolveNavigationUrl","target","page","trimmed","TypeError","resolveWebUrl","undefined","context","configuredBase","currentUrl","JSON","gotoUrlNode","agent","input","executionContext","ctx","requirePlaywrightAgent","throwIfAborted","url","response","status","result"],"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;Q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AME,cAGT;IACF,MAAM;IACN,OAAO;IACP,aACE;IACF,gBAAgB;IAChB,aAAab;IACb,MAAM,SAAQc,KAAK,EAAEC,KAAK,EAAEC,gBAAgB;QAC1C,MAAMC,MAAM;YACV,GAAGD,gBAAgB;YACnBD;YACA,SAASG,AAAAA,IAAAA,kCAAAA,sBAAAA,AAAAA,EAAuBJ;QAClC;QACAK,IAAAA,kCAAAA,cAAAA,AAAAA,EAAeF,IAAI,MAAM,EAAE;QAC3B,MAAMb,OAAOa,IAAI,OAAO,CAAC,SAAS,CAAC,cAAc;QACjD,MAAMG,MAAMlB,qBAAqBe,IAAI,KAAK,CAAC,GAAG,EAAEb;QAChD,MAAMiB,WAAW,MAAMjB,KAAK,IAAI,CAACgB,KAAK;YACpC,WAAWH,IAAI,KAAK,CAAC,SAAS;YAC9B,SAASA,IAAI,KAAK,CAAC,SAAS;QAC9B;QACAE,IAAAA,kCAAAA,cAAAA,AAAAA,EAAeF,IAAI,MAAM,EAAE;QAC3B,MAAMK,SAASD,UAAU,YAAY;QACrC,MAAME,SAAS;YACb,KAAKnB,KAAK,GAAG;YACbkB;YACA,OAAO,MAAMlB,KAAK,KAAK;QACzB;QACA,OAAO;YAAE,SAAS,CAAC,aAAa,EAAEmB,OAAO,GAAG,EAAE;YAAE,MAAMA;QAAO;IAC/D;AACF"}
@@ -1,72 +0,0 @@
1
- "use strict";
2
- var __webpack_require__ = {};
3
- (()=>{
4
- __webpack_require__.d = (exports1, definition)=>{
5
- for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
- enumerable: true,
7
- get: definition[key]
8
- });
9
- };
10
- })();
11
- (()=>{
12
- __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
- })();
14
- (()=>{
15
- __webpack_require__.r = (exports1)=>{
16
- if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
- value: 'Module'
18
- });
19
- Object.defineProperty(exports1, '__esModule', {
20
- value: true
21
- });
22
- };
23
- })();
24
- var __webpack_exports__ = {};
25
- __webpack_require__.r(__webpack_exports__);
26
- __webpack_require__.d(__webpack_exports__, {
27
- setViewportSizeInputSchema: ()=>setViewportSizeInputSchema,
28
- setViewportSizeNode: ()=>setViewportSizeNode
29
- });
30
- const v4_namespaceObject = require("zod/v4");
31
- const external_utils_js_namespaceObject = require("./utils.js");
32
- const setViewportSizeInputSchema = v4_namespaceObject.z.strictObject({
33
- width: v4_namespaceObject.z.number().int().positive().describe('Viewport width in CSS pixels.'),
34
- height: v4_namespaceObject.z.number().int().positive().describe('Viewport height in CSS pixels.')
35
- });
36
- const setViewportSizeNode = {
37
- name: 'setViewportSize',
38
- title: 'Set the browser viewport size',
39
- description: 'Set the current Playwright Page viewport size in CSS pixels and return the effective size.',
40
- stringInputKey: false,
41
- inputSchema: setViewportSizeInputSchema,
42
- async execute (agent, input, executionContext) {
43
- const ctx = {
44
- ...executionContext,
45
- input,
46
- context: (0, external_utils_js_namespaceObject.requirePlaywrightAgent)(agent)
47
- };
48
- (0, external_utils_js_namespaceObject.throwIfAborted)(ctx.signal, 'setViewportSize');
49
- const page = ctx.context.interface.underlyingPage;
50
- await page.setViewportSize({
51
- width: ctx.input.width,
52
- height: ctx.input.height
53
- });
54
- const viewport = page.viewportSize();
55
- if (!viewport) throw new Error('Playwright did not report an effective viewport size.');
56
- return {
57
- summary: `Set viewport to ${viewport.width}x${viewport.height}`,
58
- data: viewport
59
- };
60
- }
61
- };
62
- exports.setViewportSizeInputSchema = __webpack_exports__.setViewportSizeInputSchema;
63
- exports.setViewportSizeNode = __webpack_exports__.setViewportSizeNode;
64
- for(var __rspack_i in __webpack_exports__)if (-1 === [
65
- "setViewportSizeInputSchema",
66
- "setViewportSizeNode"
67
- ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
68
- Object.defineProperty(exports, '__esModule', {
69
- value: true
70
- });
71
-
72
- //# sourceMappingURL=viewport.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"playwright/test-runner/viewport.js","sources":["webpack/runtime/define_property_getters","webpack/runtime/has_own_property","webpack/runtime/make_namespace_object","../../../../src/playwright/test-runner/viewport.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 type { AgentTestRunnerNodeDefinition } from '@midscene/core/agent';\nimport { z } from 'zod/v4';\nimport { requirePlaywrightAgent, throwIfAborted } from './utils';\n\n/** Input schema for the Playwright setViewportSize Node. */\nexport const setViewportSizeInputSchema = z.strictObject({\n width: z.number().int().positive().describe('Viewport width in CSS pixels.'),\n height: z\n .number()\n .int()\n .positive()\n .describe('Viewport height in CSS pixels.'),\n});\n\n/** Validated input accepted by the Playwright setViewportSize Node. */\nexport type SetViewportSizeNodeInput = z.infer<\n typeof setViewportSizeInputSchema\n>;\n\nexport const setViewportSizeNode: AgentTestRunnerNodeDefinition<\n z.output<typeof setViewportSizeInputSchema>,\n { width: number; height: number }\n> = {\n name: 'setViewportSize',\n title: 'Set the browser viewport size',\n description:\n 'Set the current Playwright Page viewport size in CSS pixels and return the effective size.',\n stringInputKey: false,\n inputSchema: setViewportSizeInputSchema,\n async execute(agent, input, executionContext) {\n const ctx = {\n ...executionContext,\n input,\n context: requirePlaywrightAgent(agent),\n };\n throwIfAborted(ctx.signal, 'setViewportSize');\n const page = ctx.context.interface.underlyingPage;\n await page.setViewportSize({\n width: ctx.input.width,\n height: ctx.input.height,\n });\n const viewport = page.viewportSize();\n if (!viewport) {\n throw new Error('Playwright did not report an effective viewport size.');\n }\n return {\n summary: `Set viewport to ${viewport.width}x${viewport.height}`,\n data: viewport,\n };\n },\n};\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","setViewportSizeInputSchema","z","setViewportSizeNode","agent","input","executionContext","ctx","requirePlaywrightAgent","throwIfAborted","page","viewport","Error"],"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;;;;;;;;;;ACDO,MAAMI,6BAA6BC,mBAAAA,CAAAA,CAAAA,YAAc,CAAC;IACvD,OAAOA,mBAAAA,CAAAA,CAAAA,MAAQ,GAAG,GAAG,GAAG,QAAQ,GAAG,QAAQ,CAAC;IAC5C,QAAQA,mBAAAA,CAAAA,CAAAA,MACC,GACN,GAAG,GACH,QAAQ,GACR,QAAQ,CAAC;AACd;AAOO,MAAMC,sBAGT;IACF,MAAM;IACN,OAAO;IACP,aACE;IACF,gBAAgB;IAChB,aAAaF;IACb,MAAM,SAAQG,KAAK,EAAEC,KAAK,EAAEC,gBAAgB;QAC1C,MAAMC,MAAM;YACV,GAAGD,gBAAgB;YACnBD;YACA,SAASG,AAAAA,IAAAA,kCAAAA,sBAAAA,AAAAA,EAAuBJ;QAClC;QACAK,IAAAA,kCAAAA,cAAAA,AAAAA,EAAeF,IAAI,MAAM,EAAE;QAC3B,MAAMG,OAAOH,IAAI,OAAO,CAAC,SAAS,CAAC,cAAc;QACjD,MAAMG,KAAK,eAAe,CAAC;YACzB,OAAOH,IAAI,KAAK,CAAC,KAAK;YACtB,QAAQA,IAAI,KAAK,CAAC,MAAM;QAC1B;QACA,MAAMI,WAAWD,KAAK,YAAY;QAClC,IAAI,CAACC,UACH,MAAM,IAAIC,MAAM;QAElB,OAAO;YACL,SAAS,CAAC,gBAAgB,EAAED,SAAS,KAAK,CAAC,CAAC,EAAEA,SAAS,MAAM,EAAE;YAC/D,MAAMA;QACR;IACF;AACF"}
@@ -1,17 +0,0 @@
1
- import type { AgentTestRunnerNodeDefinition } from '@midscene/core/agent';
2
- import type { BrowserContext } from 'playwright';
3
- import { z } from 'zod/v4';
4
- type CookieClearOptions = NonNullable<Parameters<BrowserContext['clearCookies']>[0]>;
5
- /** Input schema for the Playwright clearCookies Node. */
6
- export declare const clearCookiesInputSchema: z.ZodObject<{
7
- name: z.ZodOptional<z.ZodString>;
8
- domain: z.ZodOptional<z.ZodString>;
9
- path: z.ZodOptional<z.ZodString>;
10
- }, z.core.$strict>;
11
- /** Validated input accepted by the Playwright clearCookies Node. */
12
- export type ClearCookiesNodeInput = z.infer<typeof clearCookiesInputSchema>;
13
- export declare const clearCookiesNode: AgentTestRunnerNodeDefinition<z.output<typeof clearCookiesInputSchema>, {
14
- filters: CookieClearOptions;
15
- }>;
16
- export {};
17
- //# sourceMappingURL=clear-cookies.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"clear-cookies.d.ts","sourceRoot":"","sources":["../../../../src/playwright/test-runner/clear-cookies.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAC;AAC1E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAG3B,KAAK,kBAAkB,GAAG,WAAW,CACnC,UAAU,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAC9C,CAAC;AAEF,yDAAyD;AACzD,eAAO,MAAM,uBAAuB;;;;kBAIlC,CAAC;AAEH,oEAAoE;AACpE,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAE5E,eAAO,MAAM,gBAAgB,EAAE,6BAA6B,CAC1D,CAAC,CAAC,MAAM,CAAC,OAAO,uBAAuB,CAAC,EACxC;IAAE,OAAO,EAAE,kBAAkB,CAAA;CAAE,CA+BhC,CAAC"}
@@ -1,33 +0,0 @@
1
- import type { AgentTestRunnerNodeDefinition } from '@midscene/core/agent';
2
- import { z } from 'zod/v4';
3
- type CookieSourceReference = {
4
- kind: 'env';
5
- name: string;
6
- } | {
7
- kind: 'profile';
8
- name: string;
9
- } | {
10
- kind: 'storage-state';
11
- name: string;
12
- };
13
- /** Input schema for the Playwright setCookies Node. */
14
- export declare const setCookiesInputSchema: z.ZodObject<{
15
- cookiesEnv: z.ZodOptional<z.ZodString>;
16
- profile: z.ZodOptional<z.ZodString>;
17
- storageStatePath: z.ZodOptional<z.ZodString>;
18
- url: z.ZodOptional<z.ZodString>;
19
- }, z.core.$strict>;
20
- /** Validated input accepted by the Playwright setCookies Node. */
21
- export type SetCookiesNodeInput = z.infer<typeof setCookiesInputSchema>;
22
- /** Secret-free metadata returned by the Playwright setCookies Node. */
23
- export interface SetCookiesNodeResult {
24
- /** Kind of configured reference used to resolve the cookies. */
25
- source: CookieSourceReference['kind'];
26
- /** Environment variable, profile, or storage-state reference name. */
27
- sourceName: string;
28
- /** Number of cookies passed to the BrowserContext. */
29
- count: number;
30
- }
31
- export declare const setCookiesNode: AgentTestRunnerNodeDefinition<z.output<typeof setCookiesInputSchema>, SetCookiesNodeResult>;
32
- export {};
33
- //# sourceMappingURL=cookies.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cookies.d.ts","sourceRoot":"","sources":["../../../../src/playwright/test-runner/cookies.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAC;AAC1E,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAS3B,KAAK,qBAAqB,GACtB;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC7B;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACjC;IAAE,IAAI,EAAE,eAAe,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAO5C,uDAAuD;AACvD,eAAO,MAAM,qBAAqB;;;;;kBAwC9B,CAAC;AAEL,kEAAkE;AAClE,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAExE,uEAAuE;AACvE,MAAM,WAAW,oBAAoB;IACnC,gEAAgE;IAChE,MAAM,EAAE,qBAAqB,CAAC,MAAM,CAAC,CAAC;IACtC,sEAAsE;IACtE,UAAU,EAAE,MAAM,CAAC;IACnB,sDAAsD;IACtD,KAAK,EAAE,MAAM,CAAC;CACf;AAuLD,eAAO,MAAM,cAAc,EAAE,6BAA6B,CACxD,CAAC,CAAC,MAAM,CAAC,OAAO,qBAAqB,CAAC,EACtC,oBAAoB,CAgDrB,CAAC"}
@@ -1,26 +0,0 @@
1
- import type { AgentTestRunnerNodeDefinition } from '@midscene/core/agent';
2
- import { z } from 'zod/v4';
3
- /** Input schema for the Playwright gotoUrl Node. */
4
- export declare const gotoUrlInputSchema: z.ZodObject<{
5
- url: z.ZodString;
6
- waitUntil: z.ZodDefault<z.ZodEnum<{
7
- domcontentloaded: "domcontentloaded";
8
- load: "load";
9
- networkidle: "networkidle";
10
- commit: "commit";
11
- }>>;
12
- timeoutMs: z.ZodDefault<z.ZodNumber>;
13
- }, z.core.$strict>;
14
- /** Validated input accepted by the Playwright gotoUrl Node. */
15
- export type GotoUrlNodeInput = z.infer<typeof gotoUrlInputSchema>;
16
- /** Structured navigation details returned by the Playwright gotoUrl Node. */
17
- export interface GotoUrlNodeResult {
18
- /** Final Page URL after navigation and redirects. */
19
- url: string;
20
- /** Main-resource HTTP status, or null when Playwright returns no response. */
21
- status: number | null;
22
- /** Document title after navigation completes. */
23
- title: string;
24
- }
25
- export declare const gotoUrlNode: AgentTestRunnerNodeDefinition<z.output<typeof gotoUrlInputSchema>, GotoUrlNodeResult>;
26
- //# sourceMappingURL=goto-url.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"goto-url.d.ts","sourceRoot":"","sources":["../../../../src/playwright/test-runner/goto-url.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAC;AAE1E,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAM3B,oDAAoD;AACpD,eAAO,MAAM,kBAAkB;;;;;;;;;kBAgB7B,CAAC;AAEH,+DAA+D;AAC/D,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAElE,6EAA6E;AAC7E,MAAM,WAAW,iBAAiB;IAChC,qDAAqD;IACrD,GAAG,EAAE,MAAM,CAAC;IACZ,8EAA8E;IAC9E,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,iDAAiD;IACjD,KAAK,EAAE,MAAM,CAAC;CACf;AA6BD,eAAO,MAAM,WAAW,EAAE,6BAA6B,CACrD,CAAC,CAAC,MAAM,CAAC,OAAO,kBAAkB,CAAC,EACnC,iBAAiB,CA8BlB,CAAC"}
@@ -1,14 +0,0 @@
1
- import type { AgentTestRunnerNodeDefinition } from '@midscene/core/agent';
2
- import { z } from 'zod/v4';
3
- /** Input schema for the Playwright setViewportSize Node. */
4
- export declare const setViewportSizeInputSchema: z.ZodObject<{
5
- width: z.ZodNumber;
6
- height: z.ZodNumber;
7
- }, z.core.$strict>;
8
- /** Validated input accepted by the Playwright setViewportSize Node. */
9
- export type SetViewportSizeNodeInput = z.infer<typeof setViewportSizeInputSchema>;
10
- export declare const setViewportSizeNode: AgentTestRunnerNodeDefinition<z.output<typeof setViewportSizeInputSchema>, {
11
- width: number;
12
- height: number;
13
- }>;
14
- //# sourceMappingURL=viewport.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"viewport.d.ts","sourceRoot":"","sources":["../../../../src/playwright/test-runner/viewport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAC;AAC1E,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAG3B,4DAA4D;AAC5D,eAAO,MAAM,0BAA0B;;;kBAOrC,CAAC;AAEH,uEAAuE;AACvE,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAC5C,OAAO,0BAA0B,CAClC,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,6BAA6B,CAC7D,CAAC,CAAC,MAAM,CAAC,OAAO,0BAA0B,CAAC,EAC3C;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CA6BlC,CAAC"}