@andrii_kremlovskyi/playwright-failure-analyzer 0.1.0 → 0.1.1

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/README.md CHANGED
@@ -109,6 +109,10 @@ CI disables stored-login fallback by default. Local usage supports existing CLI
109
109
  login; the package never starts an interactive login or stores a supplied token.
110
110
  Explicit `allowStoredLogin: false` is available for headless library consumers.
111
111
 
112
+ The SDK reads local CLI credentials independently of VS Code's sign-in.
113
+ On Windows, the isolated runtime preserves both `PATH` and `PATHEXT` so it can
114
+ discover `gh.exe` and reuse GitHub CLI authentication.
115
+
112
116
  In GitHub Actions, pass `${{ github.token }}` through `COPILOT_GITHUB_TOKEN` and
113
117
  grant the job `copilot-requests: write`. Organization-owned repositories require
114
118
  the **Allow use of Copilot CLI billed to the organization** policy. This does not
@@ -23,6 +23,7 @@ export declare function resolveAuthentication(options?: AuthenticationOptions, e
23
23
  gitHubToken?: string;
24
24
  useLoggedInUser: boolean;
25
25
  };
26
+ export declare function runtimeEnvironment(env?: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
26
27
  export declare function usingClient<T>(authentication: AuthenticationOptions, callback: (client: AnalysisClient, sdk: {
27
28
  getAuthStatus(): Promise<{
28
29
  isAuthenticated: boolean;
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.evidenceSessionConfig = void 0;
7
7
  exports.resolveAuthentication = resolveAuthentication;
8
+ exports.runtimeEnvironment = runtimeEnvironment;
8
9
  exports.usingClient = usingClient;
9
10
  const node_fs_1 = __importDefault(require("node:fs"));
10
11
  const node_os_1 = __importDefault(require("node:os"));
@@ -46,13 +47,16 @@ function resolveAuthentication(options = {}, env = process.env) {
46
47
  useLoggedInUser: !token && allowStoredLogin,
47
48
  };
48
49
  }
50
+ function runtimeEnvironment(env = process.env) {
51
+ // Keep OS/login/proxy support, not application secrets, NODE_OPTIONS or provider overrides.
52
+ // PATHEXT is needed to discover gh.exe for stored GitHub CLI authentication on Windows.
53
+ return Object.fromEntries(Object.entries(env).filter(([name]) => /^(PATH|PATHEXT|SYSTEMROOT|WINDIR|COMSPEC|HOME|USERPROFILE|HOMEDRIVE|HOMEPATH|TMP|TEMP|TMPDIR|APPDATA|LOCALAPPDATA|XDG_CONFIG_HOME|XDG_DATA_HOME|XDG_CACHE_HOME|HTTP_PROXY|HTTPS_PROXY|NO_PROXY|SSL_CERT_FILE|SSL_CERT_DIR|NODE_EXTRA_CA_CERTS|GH_HOST|GH_CONFIG_DIR)$/i.test(name)));
54
+ }
49
55
  async function usingClient(authentication, callback, signal) {
50
56
  const auth = resolveAuthentication(authentication);
51
57
  (0, shared_1.assertNotAborted)(signal);
52
58
  const { CopilotClient, RuntimeConnection } = await import("@github/copilot-sdk");
53
59
  const root = node_fs_1.default.mkdtempSync(node_path_1.default.join(node_os_1.default.tmpdir(), "playwright-failure-analyzer-"));
54
- // Keep OS/login/proxy support, not application secrets, NODE_OPTIONS or provider overrides.
55
- const environment = Object.fromEntries(Object.entries(process.env).filter(([name]) => /^(PATH|SYSTEMROOT|WINDIR|COMSPEC|HOME|USERPROFILE|HOMEDRIVE|HOMEPATH|TMP|TEMP|TMPDIR|APPDATA|LOCALAPPDATA|XDG_CONFIG_HOME|XDG_DATA_HOME|XDG_CACHE_HOME|HTTP_PROXY|HTTPS_PROXY|NO_PROXY|SSL_CERT_FILE|SSL_CERT_DIR|NODE_EXTRA_CA_CERTS|GH_HOST|GH_CONFIG_DIR)$/i.test(name)));
56
60
  const options = {
57
61
  ...auth,
58
62
  connection: RuntimeConnection.forStdio(),
@@ -61,7 +65,7 @@ async function usingClient(authentication, callback, signal) {
61
65
  baseDirectory: auth.useLoggedInUser
62
66
  ? process.env.COPILOT_HOME || node_path_1.default.join(node_os_1.default.homedir(), ".copilot")
63
67
  : root,
64
- env: environment,
68
+ env: runtimeEnvironment(),
65
69
  logLevel: "none",
66
70
  };
67
71
  const sdk = new CopilotClient(options);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@andrii_kremlovskyi/playwright-failure-analyzer",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Evidence-based Playwright failure analysis with GitHub Copilot, for local tools and CI",
5
5
  "license": "MIT",
6
6
  "type": "commonjs",