playwright 1.58.0-alpha-1764682370000 → 1.58.0-alpha-2025-12-03

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.
@@ -63,6 +63,7 @@ This project incorporates components from the projects listed below. The origina
63
63
  - @jridgewell/resolve-uri@3.1.1 (https://github.com/jridgewell/resolve-uri)
64
64
  - @jridgewell/sourcemap-codec@1.5.4 (https://github.com/jridgewell/sourcemaps)
65
65
  - @jridgewell/trace-mapping@0.3.29 (https://github.com/jridgewell/sourcemaps)
66
+ - @lowire/loop@0.0.4 (https://github.com/pavelfeldman/lowire)
66
67
  - @modelcontextprotocol/sdk@1.17.5 (https://github.com/modelcontextprotocol/typescript-sdk)
67
68
  - @sinclair/typebox@0.34.41 (https://github.com/sinclairzx81/typebox)
68
69
  - @types/istanbul-lib-coverage@2.0.6 (https://github.com/DefinitelyTyped/DefinitelyTyped)
@@ -207,7 +208,6 @@ This project incorporates components from the projects listed below. The origina
207
208
  - statuses@2.0.2 (https://github.com/jshttp/statuses)
208
209
  - stoppable@1.1.0 (https://github.com/hunterloftis/stoppable)
209
210
  - supports-color@7.2.0 (https://github.com/chalk/supports-color)
210
- - tiny-loop@0.0.10 (https://github.com/pavelfeldman/tiny-loop)
211
211
  - to-regex-range@5.0.1 (https://github.com/micromatch/to-regex-range)
212
212
  - toidentifier@1.0.1 (https://github.com/component/toidentifier)
213
213
  - type-is@2.0.1 (https://github.com/jshttp/type-is)
@@ -1980,6 +1980,212 @@ SOFTWARE.
1980
1980
  =========================================
1981
1981
  END OF @jridgewell/trace-mapping@0.3.29 AND INFORMATION
1982
1982
 
1983
+ %% @lowire/loop@0.0.4 NOTICES AND INFORMATION BEGIN HERE
1984
+ =========================================
1985
+ Apache License
1986
+ Version 2.0, January 2004
1987
+ http://www.apache.org/licenses/
1988
+
1989
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1990
+
1991
+ 1. Definitions.
1992
+
1993
+ "License" shall mean the terms and conditions for use, reproduction,
1994
+ and distribution as defined by Sections 1 through 9 of this document.
1995
+
1996
+ "Licensor" shall mean the copyright owner or entity authorized by
1997
+ the copyright owner that is granting the License.
1998
+
1999
+ "Legal Entity" shall mean the union of the acting entity and all
2000
+ other entities that control, are controlled by, or are under common
2001
+ control with that entity. For the purposes of this definition,
2002
+ "control" means (i) the power, direct or indirect, to cause the
2003
+ direction or management of such entity, whether by contract or
2004
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
2005
+ outstanding shares, or (iii) beneficial ownership of such entity.
2006
+
2007
+ "You" (or "Your") shall mean an individual or Legal Entity
2008
+ exercising permissions granted by this License.
2009
+
2010
+ "Source" form shall mean the preferred form for making modifications,
2011
+ including but not limited to software source code, documentation
2012
+ source, and configuration files.
2013
+
2014
+ "Object" form shall mean any form resulting from mechanical
2015
+ transformation or translation of a Source form, including but
2016
+ not limited to compiled object code, generated documentation,
2017
+ and conversions to other media types.
2018
+
2019
+ "Work" shall mean the work of authorship, whether in Source or
2020
+ Object form, made available under the License, as indicated by a
2021
+ copyright notice that is included in or attached to the work
2022
+ (an example is provided in the Appendix below).
2023
+
2024
+ "Derivative Works" shall mean any work, whether in Source or Object
2025
+ form, that is based on (or derived from) the Work and for which the
2026
+ editorial revisions, annotations, elaborations, or other modifications
2027
+ represent, as a whole, an original work of authorship. For the purposes
2028
+ of this License, Derivative Works shall not include works that remain
2029
+ separable from, or merely link (or bind by name) to the interfaces of,
2030
+ the Work and Derivative Works thereof.
2031
+
2032
+ "Contribution" shall mean any work of authorship, including
2033
+ the original version of the Work and any modifications or additions
2034
+ to that Work or Derivative Works thereof, that is intentionally
2035
+ submitted to Licensor for inclusion in the Work by the copyright owner
2036
+ or by an individual or Legal Entity authorized to submit on behalf of
2037
+ the copyright owner. For the purposes of this definition, "submitted"
2038
+ means any form of electronic, verbal, or written communication sent
2039
+ to the Licensor or its representatives, including but not limited to
2040
+ communication on electronic mailing lists, source code control systems,
2041
+ and issue tracking systems that are managed by, or on behalf of, the
2042
+ Licensor for the purpose of discussing and improving the Work, but
2043
+ excluding communication that is conspicuously marked or otherwise
2044
+ designated in writing by the copyright owner as "Not a Contribution."
2045
+
2046
+ "Contributor" shall mean Licensor and any individual or Legal Entity
2047
+ on behalf of whom a Contribution has been received by Licensor and
2048
+ subsequently incorporated within the Work.
2049
+
2050
+ 2. Grant of Copyright License. Subject to the terms and conditions of
2051
+ this License, each Contributor hereby grants to You a perpetual,
2052
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
2053
+ copyright license to reproduce, prepare Derivative Works of,
2054
+ publicly display, publicly perform, sublicense, and distribute the
2055
+ Work and such Derivative Works in Source or Object form.
2056
+
2057
+ 3. Grant of Patent License. Subject to the terms and conditions of
2058
+ this License, each Contributor hereby grants to You a perpetual,
2059
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
2060
+ (except as stated in this section) patent license to make, have made,
2061
+ use, offer to sell, sell, import, and otherwise transfer the Work,
2062
+ where such license applies only to those patent claims licensable
2063
+ by such Contributor that are necessarily infringed by their
2064
+ Contribution(s) alone or by combination of their Contribution(s)
2065
+ with the Work to which such Contribution(s) was submitted. If You
2066
+ institute patent litigation against any entity (including a
2067
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
2068
+ or a Contribution incorporated within the Work constitutes direct
2069
+ or contributory patent infringement, then any patent licenses
2070
+ granted to You under this License for that Work shall terminate
2071
+ as of the date such litigation is filed.
2072
+
2073
+ 4. Redistribution. You may reproduce and distribute copies of the
2074
+ Work or Derivative Works thereof in any medium, with or without
2075
+ modifications, and in Source or Object form, provided that You
2076
+ meet the following conditions:
2077
+
2078
+ (a) You must give any other recipients of the Work or
2079
+ Derivative Works a copy of this License; and
2080
+
2081
+ (b) You must cause any modified files to carry prominent notices
2082
+ stating that You changed the files; and
2083
+
2084
+ (c) You must retain, in the Source form of any Derivative Works
2085
+ that You distribute, all copyright, patent, trademark, and
2086
+ attribution notices from the Source form of the Work,
2087
+ excluding those notices that do not pertain to any part of
2088
+ the Derivative Works; and
2089
+
2090
+ (d) If the Work includes a "NOTICE" text file as part of its
2091
+ distribution, then any Derivative Works that You distribute must
2092
+ include a readable copy of the attribution notices contained
2093
+ within such NOTICE file, excluding those notices that do not
2094
+ pertain to any part of the Derivative Works, in at least one
2095
+ of the following places: within a NOTICE text file distributed
2096
+ as part of the Derivative Works; within the Source form or
2097
+ documentation, if provided along with the Derivative Works; or,
2098
+ within a display generated by the Derivative Works, if and
2099
+ wherever such third-party notices normally appear. The contents
2100
+ of the NOTICE file are for informational purposes only and
2101
+ do not modify the License. You may add Your own attribution
2102
+ notices within Derivative Works that You distribute, alongside
2103
+ or as an addendum to the NOTICE text from the Work, provided
2104
+ that such additional attribution notices cannot be construed
2105
+ as modifying the License.
2106
+
2107
+ You may add Your own copyright statement to Your modifications and
2108
+ may provide additional or different license terms and conditions
2109
+ for use, reproduction, or distribution of Your modifications, or
2110
+ for any such Derivative Works as a whole, provided Your use,
2111
+ reproduction, and distribution of the Work otherwise complies with
2112
+ the conditions stated in this License.
2113
+
2114
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
2115
+ any Contribution intentionally submitted for inclusion in the Work
2116
+ by You to the Licensor shall be under the terms and conditions of
2117
+ this License, without any additional terms or conditions.
2118
+ Notwithstanding the above, nothing herein shall supersede or modify
2119
+ the terms of any separate license agreement you may have executed
2120
+ with Licensor regarding such Contributions.
2121
+
2122
+ 6. Trademarks. This License does not grant permission to use the trade
2123
+ names, trademarks, service marks, or product names of the Licensor,
2124
+ except as required for reasonable and customary use in describing the
2125
+ origin of the Work and reproducing the content of the NOTICE file.
2126
+
2127
+ 7. Disclaimer of Warranty. Unless required by applicable law or
2128
+ agreed to in writing, Licensor provides the Work (and each
2129
+ Contributor provides its Contributions) on an "AS IS" BASIS,
2130
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
2131
+ implied, including, without limitation, any warranties or conditions
2132
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
2133
+ PARTICULAR PURPOSE. You are solely responsible for determining the
2134
+ appropriateness of using or redistributing the Work and assume any
2135
+ risks associated with Your exercise of permissions under this License.
2136
+
2137
+ 8. Limitation of Liability. In no event and under no legal theory,
2138
+ whether in tort (including negligence), contract, or otherwise,
2139
+ unless required by applicable law (such as deliberate and grossly
2140
+ negligent acts) or agreed to in writing, shall any Contributor be
2141
+ liable to You for damages, including any direct, indirect, special,
2142
+ incidental, or consequential damages of any character arising as a
2143
+ result of this License or out of the use or inability to use the
2144
+ Work (including but not limited to damages for loss of goodwill,
2145
+ work stoppage, computer failure or malfunction, or any and all
2146
+ other commercial damages or losses), even if such Contributor
2147
+ has been advised of the possibility of such damages.
2148
+
2149
+ 9. Accepting Warranty or Additional Liability. While redistributing
2150
+ the Work or Derivative Works thereof, You may choose to offer,
2151
+ and charge a fee for, acceptance of support, warranty, indemnity,
2152
+ or other liability obligations and/or rights consistent with this
2153
+ License. However, in accepting such obligations, You may act only
2154
+ on Your own behalf and on Your sole responsibility, not on behalf
2155
+ of any other Contributor, and only if You agree to indemnify,
2156
+ defend, and hold each Contributor harmless for any liability
2157
+ incurred by, or claims asserted against, such Contributor by reason
2158
+ of your accepting any such warranty or additional liability.
2159
+
2160
+ END OF TERMS AND CONDITIONS
2161
+
2162
+ APPENDIX: How to apply the Apache License to your work.
2163
+
2164
+ To apply the Apache License to your work, attach the following
2165
+ boilerplate notice, with the fields enclosed by brackets "[]"
2166
+ replaced with your own identifying information. (Don't include
2167
+ the brackets!) The text should be enclosed in the appropriate
2168
+ comment syntax for the file format. We also recommend that a
2169
+ file or class name and description of purpose be included on the
2170
+ same "printed page" as the copyright notice for easier
2171
+ identification within third-party archives.
2172
+
2173
+ Copyright (c) Microsoft Corporation.
2174
+
2175
+ Licensed under the Apache License, Version 2.0 (the "License");
2176
+ you may not use this file except in compliance with the License.
2177
+ You may obtain a copy of the License at
2178
+
2179
+ http://www.apache.org/licenses/LICENSE-2.0
2180
+
2181
+ Unless required by applicable law or agreed to in writing, software
2182
+ distributed under the License is distributed on an "AS IS" BASIS,
2183
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2184
+ See the License for the specific language governing permissions and
2185
+ limitations under the License.
2186
+ =========================================
2187
+ END OF @lowire/loop@0.0.4 AND INFORMATION
2188
+
1983
2189
  %% @modelcontextprotocol/sdk@1.17.5 NOTICES AND INFORMATION BEGIN HERE
1984
2190
  =========================================
1985
2191
  MIT License
@@ -5884,212 +6090,6 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
5884
6090
  =========================================
5885
6091
  END OF supports-color@7.2.0 AND INFORMATION
5886
6092
 
5887
- %% tiny-loop@0.0.10 NOTICES AND INFORMATION BEGIN HERE
5888
- =========================================
5889
- Apache License
5890
- Version 2.0, January 2004
5891
- http://www.apache.org/licenses/
5892
-
5893
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
5894
-
5895
- 1. Definitions.
5896
-
5897
- "License" shall mean the terms and conditions for use, reproduction,
5898
- and distribution as defined by Sections 1 through 9 of this document.
5899
-
5900
- "Licensor" shall mean the copyright owner or entity authorized by
5901
- the copyright owner that is granting the License.
5902
-
5903
- "Legal Entity" shall mean the union of the acting entity and all
5904
- other entities that control, are controlled by, or are under common
5905
- control with that entity. For the purposes of this definition,
5906
- "control" means (i) the power, direct or indirect, to cause the
5907
- direction or management of such entity, whether by contract or
5908
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
5909
- outstanding shares, or (iii) beneficial ownership of such entity.
5910
-
5911
- "You" (or "Your") shall mean an individual or Legal Entity
5912
- exercising permissions granted by this License.
5913
-
5914
- "Source" form shall mean the preferred form for making modifications,
5915
- including but not limited to software source code, documentation
5916
- source, and configuration files.
5917
-
5918
- "Object" form shall mean any form resulting from mechanical
5919
- transformation or translation of a Source form, including but
5920
- not limited to compiled object code, generated documentation,
5921
- and conversions to other media types.
5922
-
5923
- "Work" shall mean the work of authorship, whether in Source or
5924
- Object form, made available under the License, as indicated by a
5925
- copyright notice that is included in or attached to the work
5926
- (an example is provided in the Appendix below).
5927
-
5928
- "Derivative Works" shall mean any work, whether in Source or Object
5929
- form, that is based on (or derived from) the Work and for which the
5930
- editorial revisions, annotations, elaborations, or other modifications
5931
- represent, as a whole, an original work of authorship. For the purposes
5932
- of this License, Derivative Works shall not include works that remain
5933
- separable from, or merely link (or bind by name) to the interfaces of,
5934
- the Work and Derivative Works thereof.
5935
-
5936
- "Contribution" shall mean any work of authorship, including
5937
- the original version of the Work and any modifications or additions
5938
- to that Work or Derivative Works thereof, that is intentionally
5939
- submitted to Licensor for inclusion in the Work by the copyright owner
5940
- or by an individual or Legal Entity authorized to submit on behalf of
5941
- the copyright owner. For the purposes of this definition, "submitted"
5942
- means any form of electronic, verbal, or written communication sent
5943
- to the Licensor or its representatives, including but not limited to
5944
- communication on electronic mailing lists, source code control systems,
5945
- and issue tracking systems that are managed by, or on behalf of, the
5946
- Licensor for the purpose of discussing and improving the Work, but
5947
- excluding communication that is conspicuously marked or otherwise
5948
- designated in writing by the copyright owner as "Not a Contribution."
5949
-
5950
- "Contributor" shall mean Licensor and any individual or Legal Entity
5951
- on behalf of whom a Contribution has been received by Licensor and
5952
- subsequently incorporated within the Work.
5953
-
5954
- 2. Grant of Copyright License. Subject to the terms and conditions of
5955
- this License, each Contributor hereby grants to You a perpetual,
5956
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
5957
- copyright license to reproduce, prepare Derivative Works of,
5958
- publicly display, publicly perform, sublicense, and distribute the
5959
- Work and such Derivative Works in Source or Object form.
5960
-
5961
- 3. Grant of Patent License. Subject to the terms and conditions of
5962
- this License, each Contributor hereby grants to You a perpetual,
5963
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
5964
- (except as stated in this section) patent license to make, have made,
5965
- use, offer to sell, sell, import, and otherwise transfer the Work,
5966
- where such license applies only to those patent claims licensable
5967
- by such Contributor that are necessarily infringed by their
5968
- Contribution(s) alone or by combination of their Contribution(s)
5969
- with the Work to which such Contribution(s) was submitted. If You
5970
- institute patent litigation against any entity (including a
5971
- cross-claim or counterclaim in a lawsuit) alleging that the Work
5972
- or a Contribution incorporated within the Work constitutes direct
5973
- or contributory patent infringement, then any patent licenses
5974
- granted to You under this License for that Work shall terminate
5975
- as of the date such litigation is filed.
5976
-
5977
- 4. Redistribution. You may reproduce and distribute copies of the
5978
- Work or Derivative Works thereof in any medium, with or without
5979
- modifications, and in Source or Object form, provided that You
5980
- meet the following conditions:
5981
-
5982
- (a) You must give any other recipients of the Work or
5983
- Derivative Works a copy of this License; and
5984
-
5985
- (b) You must cause any modified files to carry prominent notices
5986
- stating that You changed the files; and
5987
-
5988
- (c) You must retain, in the Source form of any Derivative Works
5989
- that You distribute, all copyright, patent, trademark, and
5990
- attribution notices from the Source form of the Work,
5991
- excluding those notices that do not pertain to any part of
5992
- the Derivative Works; and
5993
-
5994
- (d) If the Work includes a "NOTICE" text file as part of its
5995
- distribution, then any Derivative Works that You distribute must
5996
- include a readable copy of the attribution notices contained
5997
- within such NOTICE file, excluding those notices that do not
5998
- pertain to any part of the Derivative Works, in at least one
5999
- of the following places: within a NOTICE text file distributed
6000
- as part of the Derivative Works; within the Source form or
6001
- documentation, if provided along with the Derivative Works; or,
6002
- within a display generated by the Derivative Works, if and
6003
- wherever such third-party notices normally appear. The contents
6004
- of the NOTICE file are for informational purposes only and
6005
- do not modify the License. You may add Your own attribution
6006
- notices within Derivative Works that You distribute, alongside
6007
- or as an addendum to the NOTICE text from the Work, provided
6008
- that such additional attribution notices cannot be construed
6009
- as modifying the License.
6010
-
6011
- You may add Your own copyright statement to Your modifications and
6012
- may provide additional or different license terms and conditions
6013
- for use, reproduction, or distribution of Your modifications, or
6014
- for any such Derivative Works as a whole, provided Your use,
6015
- reproduction, and distribution of the Work otherwise complies with
6016
- the conditions stated in this License.
6017
-
6018
- 5. Submission of Contributions. Unless You explicitly state otherwise,
6019
- any Contribution intentionally submitted for inclusion in the Work
6020
- by You to the Licensor shall be under the terms and conditions of
6021
- this License, without any additional terms or conditions.
6022
- Notwithstanding the above, nothing herein shall supersede or modify
6023
- the terms of any separate license agreement you may have executed
6024
- with Licensor regarding such Contributions.
6025
-
6026
- 6. Trademarks. This License does not grant permission to use the trade
6027
- names, trademarks, service marks, or product names of the Licensor,
6028
- except as required for reasonable and customary use in describing the
6029
- origin of the Work and reproducing the content of the NOTICE file.
6030
-
6031
- 7. Disclaimer of Warranty. Unless required by applicable law or
6032
- agreed to in writing, Licensor provides the Work (and each
6033
- Contributor provides its Contributions) on an "AS IS" BASIS,
6034
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
6035
- implied, including, without limitation, any warranties or conditions
6036
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
6037
- PARTICULAR PURPOSE. You are solely responsible for determining the
6038
- appropriateness of using or redistributing the Work and assume any
6039
- risks associated with Your exercise of permissions under this License.
6040
-
6041
- 8. Limitation of Liability. In no event and under no legal theory,
6042
- whether in tort (including negligence), contract, or otherwise,
6043
- unless required by applicable law (such as deliberate and grossly
6044
- negligent acts) or agreed to in writing, shall any Contributor be
6045
- liable to You for damages, including any direct, indirect, special,
6046
- incidental, or consequential damages of any character arising as a
6047
- result of this License or out of the use or inability to use the
6048
- Work (including but not limited to damages for loss of goodwill,
6049
- work stoppage, computer failure or malfunction, or any and all
6050
- other commercial damages or losses), even if such Contributor
6051
- has been advised of the possibility of such damages.
6052
-
6053
- 9. Accepting Warranty or Additional Liability. While redistributing
6054
- the Work or Derivative Works thereof, You may choose to offer,
6055
- and charge a fee for, acceptance of support, warranty, indemnity,
6056
- or other liability obligations and/or rights consistent with this
6057
- License. However, in accepting such obligations, You may act only
6058
- on Your own behalf and on Your sole responsibility, not on behalf
6059
- of any other Contributor, and only if You agree to indemnify,
6060
- defend, and hold each Contributor harmless for any liability
6061
- incurred by, or claims asserted against, such Contributor by reason
6062
- of your accepting any such warranty or additional liability.
6063
-
6064
- END OF TERMS AND CONDITIONS
6065
-
6066
- APPENDIX: How to apply the Apache License to your work.
6067
-
6068
- To apply the Apache License to your work, attach the following
6069
- boilerplate notice, with the fields enclosed by brackets "[]"
6070
- replaced with your own identifying information. (Don't include
6071
- the brackets!) The text should be enclosed in the appropriate
6072
- comment syntax for the file format. We also recommend that a
6073
- file or class name and description of purpose be included on the
6074
- same "printed page" as the copyright notice for easier
6075
- identification within third-party archives.
6076
-
6077
- Copyright (c) Microsoft Corporation.
6078
-
6079
- Licensed under the Apache License, Version 2.0 (the "License");
6080
- you may not use this file except in compliance with the License.
6081
- You may obtain a copy of the License at
6082
-
6083
- http://www.apache.org/licenses/LICENSE-2.0
6084
-
6085
- Unless required by applicable law or agreed to in writing, software
6086
- distributed under the License is distributed on an "AS IS" BASIS,
6087
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
6088
- See the License for the specific language governing permissions and
6089
- limitations under the License.
6090
- =========================================
6091
- END OF tiny-loop@0.0.10 AND INFORMATION
6092
-
6093
6093
  %% to-regex-range@5.0.1 NOTICES AND INFORMATION BEGIN HERE
6094
6094
  =========================================
6095
6095
  The MIT License (MIT)
@@ -24,7 +24,7 @@ module.exports = __toCommonJS(agent_exports);
24
24
  var import_bundle = require("../mcp/sdk/bundle");
25
25
  class Agent {
26
26
  constructor(loopName, spec, clients, resultSchema) {
27
- this.loop = new import_bundle.Loop(loopName);
27
+ this.loop = new import_bundle.Loop(loopName, { model: spec.model });
28
28
  this.spec = spec;
29
29
  this.clients = clients;
30
30
  this.resultSchema = resultSchema;
@@ -41,7 +41,6 @@ ${task}
41
41
  Params:
42
42
  ${JSON.stringify(params, null, 2)}`, {
43
43
  ...options,
44
- // TODO: fix types in tiny-loop
45
44
  tools,
46
45
  callTool,
47
46
  resultSchema: this.resultSchema
@@ -21,7 +21,7 @@ __export(performTask_exports, {
21
21
  performTask: () => performTask
22
22
  });
23
23
  module.exports = __toCommonJS(performTask_exports);
24
- var import_utils = require("playwright-core/lib/utils");
24
+ var import_utilsBundle = require("playwright-core/lib/utilsBundle");
25
25
  var import_browserContextFactory = require("../mcp/browser/browserContextFactory");
26
26
  var import_browserServerBackend = require("../mcp/browser/browserServerBackend");
27
27
  var import_config = require("../mcp/browser/config");
@@ -30,31 +30,20 @@ var import_server = require("../mcp/sdk/server");
30
30
  async function performTask(context, task) {
31
31
  const backend = new import_browserServerBackend.BrowserServerBackend(import_config.defaultConfig, (0, import_browserContextFactory.identityBrowserContextFactory)(context));
32
32
  const client = await (0, import_server.wrapInClient)(backend, { name: "Internal", version: "0.0.0" });
33
- const loop = new import_bundle.Loop("copilot");
33
+ const loop = new import_bundle.Loop("github", { model: "claude-sonnet-4.5" });
34
34
  const callTool = async (params) => {
35
35
  return await client.callTool(params);
36
36
  };
37
37
  try {
38
38
  return await loop.run(task, {
39
- // TODO: fix types in tiny-loop
40
39
  tools: await backend.listTools(),
41
40
  callTool,
42
- logger
41
+ debug: import_utilsBundle.debug
43
42
  });
44
43
  } finally {
45
44
  await client.close();
46
45
  }
47
46
  }
48
- function logger(category, text, details = "") {
49
- const trimmedText = trim(text, 100);
50
- const trimmedDetails = trim(details, 100 - trimmedText.length - 1);
51
- console.log(import_utils.colors.bold(import_utils.colors.green(category)), trimmedText, import_utils.colors.dim(trimmedDetails));
52
- }
53
- function trim(text, maxLength) {
54
- if (text.length <= maxLength)
55
- return text;
56
- return text.slice(0, maxLength - 3) + "...";
57
- }
58
47
  // Annotate the CommonJS export names for ESM import in node:
59
48
  0 && (module.exports = {
60
49
  performTask
@@ -36,7 +36,7 @@ class TeleSuiteUpdater {
36
36
  this._receiver = new import_teleReceiver.TeleReporterReceiver(this._createReporter(), {
37
37
  mergeProjects: true,
38
38
  mergeTestCases: true,
39
- resolvePath: (rootDir, relativePath) => rootDir + options.pathSeparator + relativePath,
39
+ resolvePath: createPathResolve(options.pathSeparator),
40
40
  clearPreviousResultsWhenTestBegins: true
41
41
  });
42
42
  this._options = options;
@@ -44,8 +44,8 @@ class TeleSuiteUpdater {
44
44
  _createReporter() {
45
45
  return {
46
46
  version: () => "v2",
47
- onConfigure: (c) => {
48
- this.config = c;
47
+ onConfigure: (config) => {
48
+ this.config = config;
49
49
  this._lastRunReceiver = new import_teleReceiver.TeleReporterReceiver({
50
50
  version: () => "v2",
51
51
  onBegin: (suite) => {
@@ -55,8 +55,9 @@ class TeleSuiteUpdater {
55
55
  }, {
56
56
  mergeProjects: true,
57
57
  mergeTestCases: false,
58
- resolvePath: (rootDir, relativePath) => rootDir + this._options.pathSeparator + relativePath
58
+ resolvePath: createPathResolve(this._options.pathSeparator)
59
59
  });
60
+ void this._lastRunReceiver.dispatch({ method: "onConfigure", params: { config } });
60
61
  },
61
62
  onBegin: (suite) => {
62
63
  if (!this.rootSuite)
@@ -131,6 +132,25 @@ class TeleSuiteUpdater {
131
132
  };
132
133
  }
133
134
  }
135
+ function createPathResolve(pathSeparator) {
136
+ return (rootDir, relativePath) => {
137
+ const segments = [];
138
+ for (const segment of [...rootDir.split(pathSeparator), ...relativePath.split(pathSeparator)]) {
139
+ const isAfterDrive = pathSeparator === "\\" && segments.length === 1 && segments[0].endsWith(":");
140
+ const isFirst = !segments.length;
141
+ if (!segment && !isFirst && !isAfterDrive)
142
+ continue;
143
+ if (segment === ".")
144
+ continue;
145
+ if (segment === "..") {
146
+ segments.pop();
147
+ continue;
148
+ }
149
+ segments.push(segment);
150
+ }
151
+ return segments.join(pathSeparator);
152
+ };
153
+ }
134
154
  // Annotate the CommonJS export names for ESM import in node:
135
155
  0 && (module.exports = {
136
156
  TeleSuiteUpdater
@@ -67,6 +67,9 @@ const defaultConfig = {
67
67
  },
68
68
  server: {},
69
69
  saveTrace: false,
70
+ snapshot: {
71
+ mode: "incremental"
72
+ },
70
73
  timeouts: {
71
74
  action: 5e3,
72
75
  navigation: 6e4
@@ -188,6 +191,7 @@ function configFromCLIOptions(cliOptions) {
188
191
  saveVideo: cliOptions.saveVideo,
189
192
  secrets: cliOptions.secrets,
190
193
  sharedBrowserContext: cliOptions.sharedBrowserContext,
194
+ snapshot: cliOptions.snapshotMode ? { mode: cliOptions.snapshotMode } : void 0,
191
195
  outputDir: cliOptions.outputDir,
192
196
  imageResponses: cliOptions.imageResponses,
193
197
  testIdAttribute: cliOptions.testIdAttribute,
@@ -310,6 +314,10 @@ function mergeConfig(base, overrides) {
310
314
  ...pickDefined(base.server),
311
315
  ...pickDefined(overrides.server)
312
316
  },
317
+ snapshot: {
318
+ ...pickDefined(base.snapshot),
319
+ ...pickDefined(overrides.snapshot)
320
+ },
313
321
  timeouts: {
314
322
  ...pickDefined(base.timeouts),
315
323
  ...pickDefined(overrides.timeouts)
@@ -62,8 +62,11 @@ class Response {
62
62
  images() {
63
63
  return this._images;
64
64
  }
65
- setIncludeSnapshot(full) {
66
- this._includeSnapshot = full ?? "incremental";
65
+ setIncludeSnapshot() {
66
+ this._includeSnapshot = this._context.config.snapshot.mode;
67
+ }
68
+ setIncludeFullSnapshot() {
69
+ this._includeSnapshot = "full";
67
70
  }
68
71
  setIncludeTabs() {
69
72
  this._includeTabs = true;
@@ -46,7 +46,7 @@ const snapshot = (0, import_tool.defineTool)({
46
46
  },
47
47
  handle: async (context, params, response) => {
48
48
  await context.ensureTab();
49
- response.setIncludeSnapshot("full");
49
+ response.setIncludeFullSnapshot();
50
50
  }
51
51
  });
52
52
  const elementSchema = import_bundle.z.object({
@@ -49,14 +49,14 @@ const browserTabs = (0, import_tool.defineTool)({
49
49
  }
50
50
  case "close": {
51
51
  await context.closeTab(params.index);
52
- response.setIncludeSnapshot("full");
52
+ response.setIncludeFullSnapshot();
53
53
  return;
54
54
  }
55
55
  case "select": {
56
56
  if (params.index === void 0)
57
57
  throw new Error("Tab index is required");
58
58
  await context.selectTab(params.index);
59
- response.setIncludeSnapshot("full");
59
+ response.setIncludeFullSnapshot();
60
60
  return;
61
61
  }
62
62
  }