@andrii_kremlovskyi/playwright-failure-analyzer 0.1.0 → 0.1.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/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
@@ -297,6 +301,10 @@ configuration discovery, and run in an isolated working directory. This limits
297
301
  agent actions; it does not make sensitive evidence safe to disclose. BYOK/provider
298
302
  environment overrides are not forwarded to the owned runtime.
299
303
 
304
+ Session state stays in an owned temporary configuration directory, which is
305
+ removed after the sessions disconnect and the runtime stops. Local login
306
+ configuration is kept separate and is not deleted during analysis cleanup.
307
+
300
308
  Screenshots can be extracted for human inspection, but are not automatically
301
309
  submitted for visual analysis. Global setup/infrastructure errors and failures
302
310
  without trace evidence are not diagnosed by a report-only model fallback.
@@ -310,9 +318,11 @@ npm pack --dry-run
310
318
  npm pack
311
319
  ```
312
320
 
313
- Tests use generated reports and fake model clients. The runtime smoke test starts
314
- the bundled runtime and requests local status only, using a synthetic credential;
315
- it performs no model inference. No real reports or credentials belong in fixtures.
321
+ Tests use generated reports and fake model clients. Real-runtime checks cover
322
+ startup and concurrent session creation/disconnection with both explicit-token
323
+ and separate local-login storage. They use synthetic credentials and an inert
324
+ loopback provider, verify temporary-state cleanup, and make no model inference
325
+ requests. No real reports or credentials belong in fixtures.
316
326
 
317
327
  Release checks cover Windows (Node 22) and Linux (Node 24), including independent
318
328
  tarball installation, CommonJS/ESM imports, declarations, the executable, and
@@ -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);
@@ -93,7 +97,9 @@ async function usingClient(authentication, callback, signal) {
93
97
  disconnect: async () => {
94
98
  if (signal?.aborted)
95
99
  return; // The owned runtime is being forcibly stopped.
96
- await (0, shared_1.withCleanup)(() => session.disconnect(), () => sdk.deleteSession(session.sessionId));
100
+ // deleteSession searches baseDirectory, not the isolated session configDirectory.
101
+ // The owned session files are removed below, after the runtime stops.
102
+ await session.disconnect();
97
103
  },
98
104
  };
99
105
  },
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.2",
4
4
  "description": "Evidence-based Playwright failure analysis with GitHub Copilot, for local tools and CI",
5
5
  "license": "MIT",
6
6
  "type": "commonjs",