testchimp-runner-core 0.0.57 → 0.0.58

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.
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AI_COMMAND_REGEX = void 0;
4
+ exports.containsAiCommand = containsAiCommand;
5
+ exports.anyContainsAiCommand = anyContainsAiCommand;
6
+ exports.normalizeCommandCollection = normalizeCommandCollection;
7
+ const AI_COMMAND_REGEX = /\bai\.(act|verify)\b/;
8
+ exports.AI_COMMAND_REGEX = AI_COMMAND_REGEX;
9
+ function containsAiCommand(text) {
10
+ if (!text) {
11
+ return false;
12
+ }
13
+ return AI_COMMAND_REGEX.test(text);
14
+ }
15
+ function anyContainsAiCommand(values) {
16
+ for (const value of values) {
17
+ if (containsAiCommand(value)) {
18
+ return true;
19
+ }
20
+ }
21
+ return false;
22
+ }
23
+ function normalizeCommandCollection(commands) {
24
+ if (!commands) {
25
+ return [];
26
+ }
27
+ if (Array.isArray(commands)) {
28
+ return commands.filter((value) => typeof value === 'string');
29
+ }
30
+ if (typeof commands === 'string') {
31
+ return [commands];
32
+ }
33
+ return [];
34
+ }
35
+ //# sourceMappingURL=ai-command-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-command-utils.js","sourceRoot":"","sources":["../../src/utils/ai-command-utils.ts"],"names":[],"mappings":";;;AAEA,8CAKC;AAED,oDAOC;AAED,gEAcC;AAhCD,MAAM,gBAAgB,GAAG,sBAAsB,CAAC;AAkCvC,4CAAgB;AAhCzB,SAAgB,iBAAiB,CAAC,IAAoB;IACpD,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACrC,CAAC;AAED,SAAgB,oBAAoB,CAAC,MAA2C;IAC9E,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,IAAI,iBAAiB,CAAC,KAAK,CAAC,EAAE,CAAC;YAC7B,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAgB,0BAA0B,CAAC,QAAiB;IAC1D,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC5B,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,KAAK,EAAmB,EAAE,CAAC,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC;IAChF,CAAC;IAED,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;QACjC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACpB,CAAC;IAED,OAAO,EAAE,CAAC;AACZ,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function runWithPlaywrightContext<T>(code: string, page: any, expectImpl: any, testImpl?: any): Promise<T>;
2
+ //# sourceMappingURL=playwright-runner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"playwright-runner.d.ts","sourceRoot":"","sources":["../../src/utils/playwright-runner.ts"],"names":[],"mappings":"AAAA,wBAAsB,wBAAwB,CAAC,CAAC,EAC9C,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,GAAG,EACT,UAAU,EAAE,GAAG,EACf,QAAQ,CAAC,EAAE,GAAG,GACb,OAAO,CAAC,CAAC,CAAC,CAIZ"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.runWithPlaywrightContext = runWithPlaywrightContext;
4
+ async function runWithPlaywrightContext(code, page, expectImpl, testImpl) {
5
+ const { ai } = require('ai-wright');
6
+ const runner = new Function('page', 'expect', 'test', 'ai', `return (async () => { ${code} })()`);
7
+ return runner(page, expectImpl, testImpl, ai);
8
+ }
9
+ //# sourceMappingURL=playwright-runner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"playwright-runner.js","sourceRoot":"","sources":["../../src/utils/playwright-runner.ts"],"names":[],"mappings":";;AAAA,4DASC;AATM,KAAK,UAAU,wBAAwB,CAC5C,IAAY,EACZ,IAAS,EACT,UAAe,EACf,QAAc;IAEd,MAAM,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IACpC,MAAM,MAAM,GAAG,IAAI,QAAQ,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,yBAAyB,IAAI,OAAO,CAAC,CAAC;IAClG,OAAO,MAAM,CAAC,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,CAAe,CAAC;AAC9D,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testchimp-runner-core",
3
- "version": "0.0.57",
3
+ "version": "0.0.58",
4
4
  "description": "Core TestChimp functionality for test generation and AI repair",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -16,6 +16,7 @@
16
16
  },
17
17
  "dependencies": {
18
18
  "@playwright/test": "^1.40.0",
19
+ "ai-wright": "^0.0.1",
19
20
  "axios": "^1.6.0",
20
21
  "dotenv": "^16.3.1",
21
22
  "esbuild": "^0.21.5",