@empiricalrun/test-gen 0.79.4 → 0.79.6

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 (150) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/agent/base/index.d.ts +2 -2
  3. package/dist/agent/base/index.d.ts.map +1 -1
  4. package/dist/agent/base/index.js +38 -7
  5. package/dist/agent/browsing/run.d.ts +1 -1
  6. package/dist/agent/browsing/run.d.ts.map +1 -1
  7. package/dist/agent/browsing/utils.d.ts +0 -7
  8. package/dist/agent/browsing/utils.d.ts.map +1 -1
  9. package/dist/agent/browsing/utils.js +9 -59
  10. package/dist/agent/chat/exports.d.ts +1 -1
  11. package/dist/agent/chat/exports.d.ts.map +1 -1
  12. package/dist/agent/chat/exports.js +1 -2
  13. package/dist/agent/chat/index.d.ts.map +1 -1
  14. package/dist/agent/chat/index.js +5 -5
  15. package/dist/agent/chat/prompt/repo.d.ts.map +1 -1
  16. package/dist/agent/chat/prompt/repo.js +24 -0
  17. package/dist/agent/chat/state.d.ts +0 -1
  18. package/dist/agent/chat/state.d.ts.map +1 -1
  19. package/dist/agent/chat/state.js +0 -28
  20. package/dist/agent/master/browser-tests/cua.spec.js +3 -3
  21. package/dist/agent/master/browser-tests/index.spec.js +2 -111
  22. package/dist/agent/master/run.d.ts +0 -1
  23. package/dist/agent/master/run.d.ts.map +1 -1
  24. package/dist/agent/master/run.js +1 -3
  25. package/dist/bin/index.js +0 -12
  26. package/dist/dashboard/client.d.ts +2 -45
  27. package/dist/dashboard/client.d.ts.map +1 -1
  28. package/dist/dashboard/client.js +4 -217
  29. package/dist/dashboard/index.d.ts +2 -4
  30. package/dist/dashboard/index.d.ts.map +1 -1
  31. package/dist/dashboard/index.js +10 -13
  32. package/dist/dashboard/tool-response-from-sandbox.d.ts +1 -4
  33. package/dist/dashboard/tool-response-from-sandbox.d.ts.map +1 -1
  34. package/dist/dashboard/tool-response-from-sandbox.js +4 -38
  35. package/dist/dashboard/tool-response.d.ts +1 -5
  36. package/dist/dashboard/tool-response.d.ts.map +1 -1
  37. package/dist/dashboard/tool-response.js +5 -87
  38. package/dist/dashboard/types.d.ts +1 -8
  39. package/dist/dashboard/types.d.ts.map +1 -1
  40. package/dist/dashboard/types.js +4 -14
  41. package/dist/file/server.d.ts +1 -1
  42. package/dist/file/server.d.ts.map +1 -1
  43. package/dist/file-info/adapters/github/reader.d.ts.map +1 -1
  44. package/dist/file-info/adapters/github/reader.js +10 -2
  45. package/dist/index.d.ts +1 -2
  46. package/dist/index.d.ts.map +1 -1
  47. package/dist/index.js +10 -32
  48. package/dist/recorder/index.d.ts.map +1 -1
  49. package/dist/recorder/index.js +3 -3
  50. package/dist/tools/api-client/index.d.ts +3 -0
  51. package/dist/tools/api-client/index.d.ts.map +1 -0
  52. package/dist/tools/api-client/index.js +73 -0
  53. package/dist/tools/create-pull-request/utils.d.ts +1 -1
  54. package/dist/tools/definitions/run-test.d.ts +2 -2
  55. package/dist/tools/definitions/run-test.d.ts.map +1 -1
  56. package/dist/tools/definitions/run-test.js +6 -5
  57. package/dist/tools/definitions/safe-bash.d.ts +1 -0
  58. package/dist/tools/definitions/safe-bash.d.ts.map +1 -1
  59. package/dist/tools/definitions/safe-bash.js +15 -6
  60. package/dist/tools/definitions/test-gen-browser.d.ts +2 -2
  61. package/dist/tools/definitions/test-gen-browser.d.ts.map +1 -1
  62. package/dist/tools/definitions/test-gen-browser.js +4 -5
  63. package/dist/tools/delete-file/index.d.ts.map +1 -1
  64. package/dist/tools/delete-file/index.js +4 -5
  65. package/dist/tools/executor/index.d.ts.map +1 -1
  66. package/dist/tools/executor/index.js +0 -4
  67. package/dist/tools/fetch-file/index.d.ts.map +1 -1
  68. package/dist/tools/fetch-file/index.js +3 -7
  69. package/dist/tools/file-operations/create.js +4 -4
  70. package/dist/tools/file-operations/insert.js +5 -5
  71. package/dist/tools/file-operations/replace.js +5 -5
  72. package/dist/tools/index.d.ts.map +1 -1
  73. package/dist/tools/index.js +0 -4
  74. package/dist/tools/issues-v1/utils.d.ts +1 -3
  75. package/dist/tools/issues-v1/utils.d.ts.map +1 -1
  76. package/dist/tools/issues-v1/utils.js +0 -16
  77. package/dist/tools/list-tests-and-projects/index.d.ts.map +1 -1
  78. package/dist/tools/list-tests-and-projects/index.js +1 -1
  79. package/dist/tools/rename-file/index.d.ts.map +1 -1
  80. package/dist/tools/rename-file/index.js +7 -4
  81. package/dist/tools/run-test.d.ts.map +1 -1
  82. package/dist/tools/run-test.js +33 -7
  83. package/dist/tools/safe-bash/index.d.ts.map +1 -1
  84. package/dist/tools/safe-bash/index.js +25 -10
  85. package/dist/tools/test-gen-browser.d.ts.map +1 -1
  86. package/dist/tools/test-gen-browser.js +27 -8
  87. package/dist/tools/utils/validators.d.ts +7 -0
  88. package/dist/tools/utils/validators.d.ts.map +1 -0
  89. package/dist/tools/utils/validators.js +93 -0
  90. package/dist/video-core/index.d.ts.map +1 -1
  91. package/dist/video-core/index.js +5 -0
  92. package/package.json +10 -10
  93. package/tsconfig.tsbuildinfo +1 -1
  94. package/dist/agent/cua/computer.d.ts +0 -14
  95. package/dist/agent/cua/computer.d.ts.map +0 -1
  96. package/dist/agent/cua/computer.js +0 -191
  97. package/dist/agent/cua/index.d.ts +0 -22
  98. package/dist/agent/cua/index.d.ts.map +0 -1
  99. package/dist/agent/cua/index.js +0 -254
  100. package/dist/agent/cua/model.d.ts +0 -25
  101. package/dist/agent/cua/model.d.ts.map +0 -1
  102. package/dist/agent/cua/model.js +0 -66
  103. package/dist/agent/cua/pw-codegen/element-from-point.d.ts +0 -10
  104. package/dist/agent/cua/pw-codegen/element-from-point.d.ts.map +0 -1
  105. package/dist/agent/cua/pw-codegen/element-from-point.js +0 -135
  106. package/dist/agent/cua/pw-codegen/factory.d.ts +0 -15
  107. package/dist/agent/cua/pw-codegen/factory.d.ts.map +0 -1
  108. package/dist/agent/cua/pw-codegen/factory.js +0 -59
  109. package/dist/agent/cua/pw-codegen/index.d.ts +0 -7
  110. package/dist/agent/cua/pw-codegen/index.d.ts.map +0 -1
  111. package/dist/agent/cua/pw-codegen/index.js +0 -14
  112. package/dist/agent/cua/pw-codegen/pw-event-sink/index.d.ts +0 -43
  113. package/dist/agent/cua/pw-codegen/pw-event-sink/index.d.ts.map +0 -1
  114. package/dist/agent/cua/pw-codegen/pw-event-sink/index.js +0 -250
  115. package/dist/agent/cua/pw-codegen/pw-pause/for-recorder.d.ts +0 -14
  116. package/dist/agent/cua/pw-codegen/pw-pause/for-recorder.d.ts.map +0 -1
  117. package/dist/agent/cua/pw-codegen/pw-pause/for-recorder.js +0 -88
  118. package/dist/agent/cua/pw-codegen/pw-pause/index.d.ts +0 -17
  119. package/dist/agent/cua/pw-codegen/pw-pause/index.d.ts.map +0 -1
  120. package/dist/agent/cua/pw-codegen/pw-pause/index.js +0 -117
  121. package/dist/agent/cua/pw-codegen/pw-pause/ipc.d.ts +0 -3
  122. package/dist/agent/cua/pw-codegen/pw-pause/ipc.d.ts.map +0 -1
  123. package/dist/agent/cua/pw-codegen/pw-pause/ipc.js +0 -13
  124. package/dist/agent/cua/pw-codegen/pw-pause/patch.d.ts +0 -24
  125. package/dist/agent/cua/pw-codegen/pw-pause/patch.d.ts.map +0 -1
  126. package/dist/agent/cua/pw-codegen/pw-pause/patch.js +0 -197
  127. package/dist/agent/cua/pw-codegen/pw-pause/types.d.ts +0 -14
  128. package/dist/agent/cua/pw-codegen/pw-pause/types.d.ts.map +0 -1
  129. package/dist/agent/cua/pw-codegen/pw-pause/types.js +0 -2
  130. package/dist/agent/cua/pw-codegen/pw-pause/utils.d.ts +0 -2
  131. package/dist/agent/cua/pw-codegen/pw-pause/utils.d.ts.map +0 -1
  132. package/dist/agent/cua/pw-codegen/pw-pause/utils.js +0 -6
  133. package/dist/agent/cua/pw-codegen/types.d.ts +0 -47
  134. package/dist/agent/cua/pw-codegen/types.d.ts.map +0 -1
  135. package/dist/agent/cua/pw-codegen/types.js +0 -2
  136. package/dist/agent/cua/pw-codegen/version.d.ts +0 -25
  137. package/dist/agent/cua/pw-codegen/version.d.ts.map +0 -1
  138. package/dist/agent/cua/pw-codegen/version.js +0 -86
  139. package/dist/bin/environments.d.ts +0 -6
  140. package/dist/bin/environments.d.ts.map +0 -1
  141. package/dist/bin/environments.js +0 -99
  142. package/dist/tools/definitions/upgrade-packages.d.ts +0 -14
  143. package/dist/tools/definitions/upgrade-packages.d.ts.map +0 -1
  144. package/dist/tools/definitions/upgrade-packages.js +0 -21
  145. package/dist/tools/upgrade-packages/index.d.ts +0 -3
  146. package/dist/tools/upgrade-packages/index.d.ts.map +0 -1
  147. package/dist/tools/upgrade-packages/index.js +0 -134
  148. package/dist/tools/upgrade-packages/utils.d.ts +0 -28
  149. package/dist/tools/upgrade-packages/utils.d.ts.map +0 -1
  150. package/dist/tools/upgrade-packages/utils.js +0 -152
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @empiricalrun/test-gen
2
2
 
3
+ ## 0.79.6
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [b4e2fff]
8
+ - @empiricalrun/cua@0.3.0
9
+ - @empiricalrun/llm@0.26.0
10
+ - videostil@0.3.5
11
+
12
+ ## 0.79.5
13
+
14
+ ### Patch Changes
15
+
16
+ - b58777e: refactor: extract CUA agent into standalone @empiricalrun/cua package
17
+ - fda9bc3: feat: extract DashboardAPIClient into standalone @empiricalrun/dashboard-client package
18
+ - Updated dependencies [b58777e]
19
+ - Updated dependencies [fda9bc3]
20
+ - @empiricalrun/cua@0.2.0
21
+ - @empiricalrun/dashboard-client@0.2.0
22
+
3
23
  ## 0.79.4
4
24
 
5
25
  ### Patch Changes
@@ -1,5 +1,5 @@
1
1
  import { type IChatModel } from "@empiricalrun/llm/chat";
2
- import type { CanonicalMessage, ChatState, ChatStateGeneric, MessageCheckpoint, PendingToolCall, ReporterFunction, StreamingMessageReporterFunc, SupportedChatModels, TextMessagePart, TextMessageWithAttachmentsPart, ToolResult, ToolsForLLM } from "@empiricalrun/shared-types/chat-agent";
2
+ import type { CanonicalMessage, ChatState, ChatStateGeneric, MessageCheckpoint, PendingToolCall, ProcessToolResultsResult, ReporterFunction, StreamingMessageReporterFunc, SupportedChatModels, TextMessagePart, TextMessageWithAttachmentsPart, ToolResult, ToolsForLLM } from "@empiricalrun/shared-types/chat-agent";
3
3
  import type { TraceClient } from "@empiricalrun/shared-types/common";
4
4
  import type { FileInfo } from "@empiricalrun/shared-types/test-gen";
5
5
  import type { IToolExecutor } from "../../tools/executor/types";
@@ -50,7 +50,7 @@ export declare abstract class BaseAgent<T> {
50
50
  setChatState(chatState: ChatStateGeneric<T>): void;
51
51
  changeModel(newModel: SupportedChatModels): void;
52
52
  stop(): ChatStateGeneric<T>;
53
- processToolResults(toolCalls: PendingToolCall[], toolResults: ToolResult[], checkpoint: MessageCheckpoint | null): ChatState | undefined;
53
+ processToolResults(toolCalls: PendingToolCall[], toolResults: ToolResult[], checkpoint: MessageCheckpoint | null): ProcessToolResultsResult;
54
54
  toolCallHandler(toolCalls: PendingToolCall[]): Promise<void>;
55
55
  runLoop(params: RunLoopParams<any>): Promise<void>;
56
56
  getHumanReadableLatestMessage(): {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/agent/base/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAO,KAAK,EACV,gBAAgB,EAChB,SAAS,EACT,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,4BAA4B,EAC5B,mBAAmB,EACnB,eAAe,EACf,8BAA8B,EAC9B,UAAU,EACV,WAAW,EACZ,MAAM,uCAAuC,CAAC;AAC/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AAEpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAA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C;IAoB5D,OAAO,CAAC,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC;IA2BxC,6BAA6B,IACzB;QACE,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,MAAM,CAAC;KACrB,GACD,SAAS;CAGd"}
@@ -97,12 +97,43 @@ class BaseAgent {
97
97
  if (filteredToolCalls.length > 0) {
98
98
  this.chatModel.pushToolResultsMessage(filteredToolCalls, filteredToolResults, checkpoint);
99
99
  return {
100
- ...this.chatState,
101
- messages: this.chatModel.messages,
102
- askUserForInput: this.chatModel.askUserForInput,
100
+ status: "accepted",
101
+ chatState: {
102
+ ...this.chatState,
103
+ messages: this.chatModel.messages,
104
+ askUserForInput: this.chatModel.askUserForInput,
105
+ },
103
106
  };
104
107
  }
105
- return undefined;
108
+ // Check if these tool calls were already completed (idempotent retry)
109
+ const messages = this.chatModel.messages;
110
+ const completedToolCallIds = new Set();
111
+ for (const msg of messages) {
112
+ if (msg.role === "tool") {
113
+ for (const part of msg.parts) {
114
+ if ("toolCallId" in part && part.toolCallId) {
115
+ completedToolCallIds.add(part.toolCallId);
116
+ }
117
+ }
118
+ }
119
+ }
120
+ if (toolCalls.every((tc) => completedToolCallIds.has(tc.id))) {
121
+ console.log(`[processToolResults] Tool calls already completed (idempotent retry): ${toolCalls.map((tc) => `${tc.id} (${tc.name})`).join(", ")}`);
122
+ return { status: "already_accepted" };
123
+ }
124
+ // Diagnose why no tool calls matched
125
+ for (const call of toolCalls) {
126
+ if (completedToolCallIds.has(call.id)) {
127
+ console.log(`[processToolResults] Tool call ${call.id} (${call.name}) already has a result`);
128
+ }
129
+ else {
130
+ console.log(`[processToolResults] Tool call ${call.id} (${call.name}) not found in messages (${messages.length} messages)`);
131
+ }
132
+ }
133
+ if (pendingToolCalls.length > 0) {
134
+ console.log(`[processToolResults] Pending tool calls: ${pendingToolCalls.map((p) => `${p.id} (${p.name})`).join(", ")}`);
135
+ }
136
+ return { status: "rejected" };
106
137
  }
107
138
  async toolCallHandler(toolCalls) {
108
139
  if (!this.toolExecutor) {
@@ -113,9 +144,9 @@ class BaseAgent {
113
144
  }
114
145
  const result = await this.toolExecutor.execute(toolCalls);
115
146
  if (result.status === "completed") {
116
- const newChatState = this.processToolResults(toolCalls, result.toolResults, result.checkpoint);
117
- if (newChatState && this.onToolResultsProcessed) {
118
- await this.onToolResultsProcessed(newChatState);
147
+ const { status, chatState } = this.processToolResults(toolCalls, result.toolResults, result.checkpoint);
148
+ if (status === "accepted" && chatState && this.onToolResultsProcessed) {
149
+ await this.onToolResultsProcessed(chatState);
119
150
  }
120
151
  }
121
152
  }
@@ -1,5 +1,5 @@
1
+ import { BrowserAgentResult } from "@empiricalrun/cua";
1
2
  import { Usage } from "@empiricalrun/shared-types/chat-agent";
2
- import { BrowserAgentResult } from "../cua";
3
3
  type GenerateTestsType = {
4
4
  testCaseName: string;
5
5
  testCaseSuites: string[];
@@ -1 +1 @@
1
- {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/agent/browsing/run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,uCAAuC,CAAC;AAa9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAG5C,KAAK,iBAAiB,GAAG;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,yBAAyB,EAAE,OAAO,CAAC;IACnC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACtC,CAAC;AAEF,wBAAsB,8BAA8B,CAAC,EACnD,gBAAgB,EAChB,OAAO,EACP,YAAY,GACb,EAAE;IACD,gBAAgB,EAAE,MAA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O,CAAC,MAAM,CAAC,CAQlB;AAED,wBAAsB,gBAAgB,CAAC,EACrC,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,WAAW,EACX,YAAY,EACZ,OAAO,EACP,OAAO,EACP,yBAAyB,EACzB,YAAY,GACb,EAAE,iBAAiB,GAAG,OAAO,CAAC;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,kBAAkB,GAAG,SAAS,CAAC;IACvC,KAAK,EAAE,KAAK,GAAG,SAAS,CAAC;CAC1B,CAAC,CA+FD"}
@@ -1,21 +1,14 @@
1
1
  import { Page } from "playwright";
2
2
  import { PlaywrightTestConfig } from "playwright/test";
3
3
  export declare function isRegExp(obj: any): obj is RegExp;
4
- export declare function prepareBrowsingAgentTask(steps: string[]): string;
5
4
  export declare function addImportForMethod(testFilePath: string, methodName: string): void;
6
5
  export declare function replaceTodoWithCreateTest(testFilePath: string, repoDir: string): string | undefined;
7
- export declare function markTestAsOnly({ testCaseName, testCaseSuites, specPath, }: {
8
- testCaseName: string;
9
- testCaseSuites: string[];
10
- specPath: string;
11
- }): Promise<void>;
12
6
  export declare function injectPwLocatorGenerator(page: Page): Promise<void>;
13
7
  /**
14
8
  * function to read playwright config from the source repo
15
9
  * @return {*} {Promise<PlaywrightTestConfig>}
16
10
  */
17
11
  export declare function readPlaywrightConfig(repoDir: string): Promise<PlaywrightTestConfig>;
18
- export declare function getValidProjectNames(playwrightConfig: PlaywrightTestConfig): Promise<string[]>;
19
12
  /**
20
13
  * detect the project name for the given file in playwright test repo
21
14
  * if project and test file path for running test don't match, then playwright throws error
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/agent/browsing/utils.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAYvD,wBA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mB1E;AAED,wBAAgB,yBAAyB,CACvC,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,MAAM,GACd,MAAM,GAAG,SAAS,CAsBpB;AAED,wBAAsB,wBAAwB,CAAC,IAAI,EAAE,IAAI,iBA0GxD;AAED;;;GAGG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,oBAAoB,CAAC,CA2B/B;AAWD;;;;;GAKG;AACH,wBAAsB,iBAAiB,CACrC,YAAY,EAAE,MAAM,EACpB,gBAAgB,EAAE,oBAAoB,EACtC,gBAAgB,GAAE,MAAM,EAAU,GACjC,OAAO,CAAC,MAAM,CAAC,CA+CjB"}
@@ -4,13 +4,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.isRegExp = isRegExp;
7
- exports.prepareBrowsingAgentTask = prepareBrowsingAgentTask;
8
7
  exports.addImportForMethod = addImportForMethod;
9
8
  exports.replaceTodoWithCreateTest = replaceTodoWithCreateTest;
10
- exports.markTestAsOnly = markTestAsOnly;
11
9
  exports.injectPwLocatorGenerator = injectPwLocatorGenerator;
12
10
  exports.readPlaywrightConfig = readPlaywrightConfig;
13
- exports.getValidProjectNames = getValidProjectNames;
14
11
  exports.detectProjectName = detectProjectName;
15
12
  const fs_1 = __importDefault(require("fs"));
16
13
  const minimatch_1 = require("minimatch");
@@ -22,15 +19,15 @@ function isRegExp(obj) {
22
19
  return (obj instanceof RegExp ||
23
20
  Object.prototype.toString.call(obj) === "[object RegExp]");
24
21
  }
25
- function prepareBrowsingAgentTask(steps) {
26
- const sanitizedSteps = steps.map((step) => step.replace(/`/g, "\\`"));
27
- const task = `${sanitizedSteps.join("\n")}\n`;
28
- return task;
29
- }
30
22
  function addImportForMethod(testFilePath, methodName) {
31
- // Instead of using "@empiricalrun/test-gen", we use the local dist file
32
- // This is to avoid assuming that the test-gen package is installed in the project
33
- const importSource = path_1.default.join(__dirname, "../../../dist/index.js");
23
+ let importSource;
24
+ try {
25
+ importSource = require.resolve("@empiricalrun/test-gen");
26
+ }
27
+ catch {
28
+ // Fallback for bundled context (e.g. sandbox-wrapper)
29
+ importSource = path_1.default.join(__dirname, "index.js");
30
+ }
34
31
  if (!fs_1.default.existsSync(importSource)) {
35
32
  throw new Error(`createTest import source not found at ${importSource}`);
36
33
  }
@@ -50,50 +47,12 @@ function replaceTodoWithCreateTest(testFilePath, repoDir) {
50
47
  addImportForMethod(absoluteTestFilePath, "createTest");
51
48
  return todoContent;
52
49
  }
53
- async function markTestAsOnly({ testCaseName, testCaseSuites, specPath, }) {
54
- const testFileContent = fs_1.default.readFileSync(specPath, "utf-8");
55
- const { testBlock, testNode } = (0, web_1.getTypescriptTestBlock)({
56
- scenarioName: testCaseName,
57
- content: testFileContent,
58
- suites: testCaseSuites,
59
- });
60
- const parentDescribe = (0, web_1.findFirstSerialDescribeBlock)(testNode);
61
- const isFileMarkedSerial = await (0, web_1.hasTopLevelDescribeConfigureWithSerialMode)(specPath);
62
- // add test.only / describe.only to the spec file so that only that block is executed
63
- if (!isFileMarkedSerial) {
64
- const updatedTestFileContent = newContentsWithTestOnly(testFileContent, testBlock, testBlock, parentDescribe?.getText() || "");
65
- fs_1.default.writeFileSync(specPath, updatedTestFileContent);
66
- }
67
- }
68
- function newContentsWithTestOnly(existingContents, originalTestBlock, updatedTestBlock, parentDescribeBlock) {
69
- if (!parentDescribeBlock) {
70
- const testMarkedAsOnly = updatedTestBlock.replace("test(", "test.only(");
71
- return existingContents.replace(originalTestBlock, testMarkedAsOnly);
72
- }
73
- else {
74
- const updatedDescribeBlock = parentDescribeBlock.replace(originalTestBlock, updatedTestBlock);
75
- // TODO: this should only happen when the describe block has "serial" execution
76
- const describeMarkedAsOnly = updatedDescribeBlock.replace("test.describe(", "test.describe.only(");
77
- return existingContents.replace(parentDescribeBlock, describeMarkedAsOnly);
78
- }
79
- }
80
50
  async function injectPwLocatorGenerator(page) {
81
- let pathToInstalledTestGen = require.resolve(".").split("dist")[0];
82
- if (process.env.RUNNING_BROWSER_TESTS_FOR_TEST_GEN) {
83
- pathToInstalledTestGen = process.cwd();
84
- }
85
- const annotateElementPath = path_1.default.join(pathToInstalledTestGen, "dist", "browser-injected-scripts", "annotate-elements.js");
86
- if (!fs_1.default.existsSync(annotateElementPath)) {
87
- throw new Error(`annotate-elements.js not found at path: ${annotateElementPath}`);
88
- }
89
51
  const remoteScriptResponses = await Promise.all([
90
52
  "https://assets-test.empirical.run/pw-selector.js",
91
53
  "https://code.jquery.com/jquery-3.7.1.min.js",
92
54
  ].map((url) => fetch(url)));
93
- const scripts = await Promise.all([
94
- ...remoteScriptResponses.map((r) => r.text()),
95
- fs_1.default.readFileSync(annotateElementPath, "utf-8"),
96
- ]);
55
+ const scripts = await Promise.all(remoteScriptResponses.map((r) => r.text()));
97
56
  page.on("load", async () => {
98
57
  try {
99
58
  await Promise.all(scripts.map((s) => page.addScriptTag({ content: s })));
@@ -219,15 +178,6 @@ function matchAgainstPattern(pattern, filePathToTest) {
219
178
  return (0, minimatch_1.minimatch)(filePathToTest, pattern);
220
179
  }
221
180
  }
222
- async function getValidProjectNames(playwrightConfig) {
223
- if (!playwrightConfig.projects) {
224
- return [];
225
- }
226
- const filteredProjectNames = playwrightConfig.projects
227
- .map((p) => p.name)
228
- .filter((p) => !!p);
229
- return filteredProjectNames;
230
- }
231
181
  /**
232
182
  * detect the project name for the given file in playwright test repo
233
183
  * if project and test file path for running test don't match, then playwright throws error
@@ -9,6 +9,6 @@ export { CodeReviewAgent } from "../code-review";
9
9
  export { FastTriageAgent } from "../fast-triage";
10
10
  export { TriageAgent } from "../triage";
11
11
  export { ChatAgent } from "./index";
12
- export { fetchToolCallFromId, getLatestDownloadBuildUrl, LATEST_CHAT_STATE_VERSION, } from "./state";
12
+ export { fetchToolCallFromId, LATEST_CHAT_STATE_VERSION } from "./state";
13
13
  export { extractAttachments } from "./utils";
14
14
  //# sourceMappingURL=exports.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../../src/agent/chat/exports.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EACL,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,iCAAiC,CAAC;AAEzC,YAAY,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,YAAY,EACV,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,yBAAyB,GAC1B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EACL,mBAAmB,EACnB,yBAAyB,EACzB,yBAAyB,GAC1B,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../../src/agent/chat/exports.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EACL,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,iCAAiC,CAAC;AAEzC,YAAY,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,YAAY,EACV,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,yBAAyB,GAC1B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.extractAttachments = exports.LATEST_CHAT_STATE_VERSION = exports.getLatestDownloadBuildUrl = exports.fetchToolCallFromId = exports.ChatAgent = exports.TriageAgent = exports.FastTriageAgent = exports.CodeReviewAgent = exports.BaseAgent = exports.viewFileUsingGitHub = exports.getFileInfoFromGitHub = exports.SUPPORTED_CHAT_MODELS = exports.createChatModel = void 0;
3
+ exports.extractAttachments = exports.LATEST_CHAT_STATE_VERSION = exports.fetchToolCallFromId = exports.ChatAgent = exports.TriageAgent = exports.FastTriageAgent = exports.CodeReviewAgent = exports.BaseAgent = exports.viewFileUsingGitHub = exports.getFileInfoFromGitHub = exports.SUPPORTED_CHAT_MODELS = exports.createChatModel = void 0;
4
4
  var chat_1 = require("@empiricalrun/llm/chat");
5
5
  Object.defineProperty(exports, "createChatModel", { enumerable: true, get: function () { return chat_1.createChatModel; } });
6
6
  var constants_1 = require("@empiricalrun/llm/chat/constants");
@@ -20,7 +20,6 @@ var index_1 = require("./index");
20
20
  Object.defineProperty(exports, "ChatAgent", { enumerable: true, get: function () { return index_1.ChatAgent; } });
21
21
  var state_1 = require("./state");
22
22
  Object.defineProperty(exports, "fetchToolCallFromId", { enumerable: true, get: function () { return state_1.fetchToolCallFromId; } });
23
- Object.defineProperty(exports, "getLatestDownloadBuildUrl", { enumerable: true, get: function () { return state_1.getLatestDownloadBuildUrl; } });
24
23
  Object.defineProperty(exports, "LATEST_CHAT_STATE_VERSION", { enumerable: true, get: function () { return state_1.LATEST_CHAT_STATE_VERSION; } });
25
24
  var utils_1 = require("./utils");
26
25
  Object.defineProperty(exports, "extractAttachments", { enumerable: true, get: function () { return utils_1.extractAttachments; } });
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/agent/chat/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACzE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AAsBpE,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAMpC,qBAAa,SAAS,CAAC,CAAC,CAAE,SAAQ,SAAS,CAAC,CAAC,CAAC;IAC5C,SAAS,CAAC,QAAQ,IAAI,WAAW;IA0B3B,iBAAiB,CACrB,eAAe,EAAE,MAAM,OAAO,CAAC,QAAQ,CAAC,GACvC,OAAO,CAAC,MAAM,CAAC;CAyGnB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/agent/chat/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACzE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AAsBpE,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAMpC,qBAAa,SAAS,CAAC,CAAC,CAAE,SAAQ,SAAS,CAAC,CAAC,CAAC;IAC5C,SAAS,CAAC,QAAQ,IAAI,WAAW;IA2B3B,iBAAiB,CACrB,eAAe,EAAE,MAAM,OAAO,CAAC,QAAQ,CAAC,GACvC,OAAO,CAAC,MAAM,CAAC;CAwGnB"}
@@ -2,8 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ChatAgent = void 0;
4
4
  const tools_1 = require("../../tools");
5
+ const api_client_1 = require("../../tools/api-client");
5
6
  const analyse_video_1 = require("../../tools/definitions/analyse-video");
6
- const download_build_1 = require("../../tools/definitions/download-build");
7
7
  const grep_1 = require("../../tools/definitions/grep");
8
8
  const list_tests_and_projects_1 = require("../../tools/definitions/list-tests-and-projects");
9
9
  const run_test_1 = require("../../tools/definitions/run-test");
@@ -18,17 +18,18 @@ const test_case_def_1 = require("./prompt/test-case-def");
18
18
  const trace_utils_docs_1 = require("./prompt/trace-utils-docs");
19
19
  class ChatAgent extends base_1.BaseAgent {
20
20
  getTools() {
21
+ const useAPIClientTool = this.featureFlags.includes("useAPIClientTool");
21
22
  const custom = [
22
23
  analyse_video_1.analyseVideo,
23
24
  run_test_1.runTestTool,
24
25
  grep_1.grepTool,
25
- list_environments_1.listEnvironmentsTool,
26
- download_build_1.downloadBuildTool,
26
+ ...(useAPIClientTool
27
+ ? [api_client_1.apiClientTool]
28
+ : [list_environments_1.listEnvironmentsTool, test_run_fetcher_1.fetchTestRunDetailsTool]),
27
29
  fetch_file_1.fetchFileTool,
28
30
  list_tests_and_projects_1.listProjectsTool,
29
31
  list_tests_and_projects_1.listTestsForProjectTool,
30
32
  ...tools_1.testGenerationTools,
31
- test_run_fetcher_1.fetchTestRunDetailsTool,
32
33
  diagnosis_fetcher_1.fetchDiagnosisReportTool,
33
34
  ...(0, tools_1.textEditorToolsForModel)(this.selectedModel),
34
35
  tools_1.safeBashTool,
@@ -45,7 +46,6 @@ class ChatAgent extends base_1.BaseAgent {
45
46
  async buildSystemPrompt(repoInfoBuilder) {
46
47
  const repoInfo = await repoInfoBuilder();
47
48
  const repoContext = await (0, repo_1.getRepoContextPrompt)(repoInfo);
48
- const hasTraceUtils = this.featureFlags.includes("enableTraceUtilsViaBash");
49
49
  const preamble = `
50
50
  You are a helpful assistant that can answer questions and help with tasks related to writing and maintaining Playwright tests.
51
51
 
@@ -1 +1 @@
1
- {"version":3,"file":"repo.d.ts","sourceRoot":"","sources":["../../../../src/agent/chat/prompt/repo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AAuD/D,wBAAsB,oBAAoB,CAAC,QAAQ,EAAE,QAAQ,mBA4B5D"}
1
+ {"version":3,"file":"repo.d.ts","sourceRoot":"","sources":["../../../../src/agent/chat/prompt/repo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AAoF/D,wBAAsB,oBAAoB,CAAC,QAAQ,EAAE,QAAQ,mBA8B5D"}
@@ -6,6 +6,28 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.getRepoContextPrompt = getRepoContextPrompt;
7
7
  const path_1 = __importDefault(require("path"));
8
8
  const repo_tree_1 = require("../../../utils/repo-tree");
9
+ async function environmentsYamlSection(directory) {
10
+ if (directory.type !== "directory") {
11
+ return "";
12
+ }
13
+ const empiricalrunDir = directory.children.find((child) => child.type === "directory" && child.path === ".empiricalrun");
14
+ if (!empiricalrunDir || empiricalrunDir.type !== "directory") {
15
+ return "";
16
+ }
17
+ const envFile = empiricalrunDir.children.find((child) => child.type === "file" &&
18
+ path_1.default.basename(child.path) === "ENVIRONMENTS.yaml");
19
+ if (!envFile || envFile.type !== "file") {
20
+ return "";
21
+ }
22
+ const content = await envFile.getContent();
23
+ return `## Environments
24
+
25
+ The repo is configured to run tests for these environments with .empiricalrun/ENVIRONMENTS.yaml (see docs: https://docs.empirical.run/agents/env-vars)
26
+
27
+ \`\`\`yaml
28
+ ${content}
29
+ \`\`\``;
30
+ }
9
31
  async function getAllMarkdownFiles(directory) {
10
32
  if (directory.type !== "directory") {
11
33
  return [];
@@ -60,6 +82,8 @@ While specifying paths to files, prefer using absolute paths with the /repo/ pre
60
82
  - Preferred: "/repo/tests/lesson.spec.ts" (absolute path with /repo/ prefix)
61
83
  - Also supported: "tests/lesson.spec.ts" (relative path from repository root)
62
84
  - Incorrect: "/${repoInfo.name}/tests/lesson.spec.ts" (wrong prefix)
85
+
86
+ ${await environmentsYamlSection(repoInfo)}
63
87
  `;
64
88
  const knowledge = await knowledgeContext(repoInfo);
65
89
  if (knowledge.length > 0) {
@@ -18,7 +18,6 @@ export declare function loadChatState<T>({ resetChat, }: {
18
18
  resetChat: boolean;
19
19
  }): ChatStateGeneric<T> | undefined;
20
20
  export declare function saveToDisk<T>(chatState: ChatStateGeneric<T>): void;
21
- export declare function getLatestDownloadBuildUrl(messages: CanonicalMessage[]): string | null;
22
21
  export declare function fetchToolCallFromId(toolCallId: String, messages: CanonicalMessage[]): {
23
22
  toolCallQueuedAt: Date | undefined;
24
23
  toolCall: PendingToolCall | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../src/agent/chat/state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,eAAe,EAEf,UAAU,EACX,MAAM,uCAAuC,CAAC;AAM/C,eAAO,MAAM,kCAAkC,EAAE,MAAM,CACrD,MAAM,EACN,CAAC,KAAK,EAAE,GAAG,KAAK,GAAG,CAGpB,CAAC;AAEF,eAAO,MAAM,yBAAyB,QAAQ,CAAC;AAE/C,eAAO,MAAM,eAAe,QAI3B,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,EACpC,SAAS,EACT,KAAK,GACN,EAAE;IACD,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;IACzB,KAAK,EAAE,cAAc,GAAG,IAAI,CAAC;CAC9B;;;;;;EAQA;AAED,wBAAgB,eAAe,CAAC,CAAC,GAAG,gBAAgB,EAClD,SAAS,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAC7B,MAAM,CA4BR;AAED,wBAAgB,aAAa,C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R;AAED,wBAAgB,aAAa,CAAC,CAAC,EAAE,EAC/B,SAAS,GACV,EAAE;IACD,SAAS,EAAE,OAAO,CAAC;CACpB,GAAG,gBAAgB,CAAC,CAAC,CAAC,GAAG,SAAS,CAoBlC;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,SAAS,EAAE,gBAAgB,CAAC,CAAC,CAAC,QAQ3D;AAED,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,gBAAgB,EAAE,GAC3B;IACD,gBAAgB,EAAE,IAAI,GAAG,SAAS,CAAC;IACnC,QAAQ,EAAE,eAAe,GAAG,SAAS,CAAC;IACtC,UAAU,EAAE,UAAU,GAAG,SAAS,CAAC;CACpC,CA0BA"}
@@ -8,7 +8,6 @@ exports.chatStateFromModel = chatStateFromModel;
8
8
  exports.getUsageSummary = getUsageSummary;
9
9
  exports.loadChatState = loadChatState;
10
10
  exports.saveToDisk = saveToDisk;
11
- exports.getLatestDownloadBuildUrl = getLatestDownloadBuildUrl;
12
11
  exports.fetchToolCallFromId = fetchToolCallFromId;
13
12
  const fs_1 = __importDefault(require("fs"));
14
13
  const path_1 = __importDefault(require("path"));
@@ -77,33 +76,6 @@ function saveToDisk(chatState) {
77
76
  }
78
77
  fs_1.default.writeFileSync(statePath, JSON.stringify(chatState, null, 2));
79
78
  }
80
- function findLatestToolCall(messages, toolName) {
81
- return messages
82
- .sort((a, b) => new Date(b.timestamp).getTime() - new Date(a.timestamp).getTime())
83
- .find((m) => m.parts.some((p) => "toolCall" in p && p.toolCall?.name === toolName));
84
- }
85
- function findSuccessfulToolResponse(messages, toolCallId) {
86
- return messages.find((m) => m.parts.some((p) => {
87
- if ("toolResult" in p) {
88
- return p.toolCallId === toolCallId && !p.toolResult.isError;
89
- }
90
- return false;
91
- }));
92
- }
93
- function getLatestDownloadBuildUrl(messages) {
94
- const toolCallMessage = findLatestToolCall(messages, "downloadBuild");
95
- if (!toolCallMessage)
96
- return null;
97
- const toolCallPart = toolCallMessage.parts.find((p) => "toolCall" in p && p.toolCall?.name === "downloadBuild");
98
- if (!toolCallPart || !("toolCall" in toolCallPart))
99
- return null;
100
- const toolCallId = toolCallPart.toolCall.id;
101
- const toolResponseMessage = findSuccessfulToolResponse(messages, toolCallId);
102
- if (!toolResponseMessage)
103
- return null;
104
- const input = toolCallPart.toolCall.input;
105
- return input.buildUrl;
106
- }
107
79
  function fetchToolCallFromId(toolCallId, messages) {
108
80
  const toolCallMessage = messages.find((message) => message.parts.some((part) => {
109
81
  return "toolCall" in part && part.toolCallId === toolCallId;
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const run_1 = require("../run");
3
+ const cua_1 = require("@empiricalrun/cua");
4
4
  const fixtures_1 = require("./fixtures");
5
5
  fixtures_1.test.skip("computer use agent generates code for iframes", async ({ page, server, }) => {
6
6
  await page.goto(`${server.baseURL}/iframe-elements.html`);
7
- const result = await (0, run_1.createTestUsingComputerUseAgent)({
7
+ const result = await (0, cua_1.createTestUsingComputerUseAgent)({
8
8
  page,
9
9
  task: `Click on both of the "Enter your name" input fields`,
10
10
  });
@@ -13,7 +13,7 @@ fixtures_1.test.skip("computer use agent generates code for iframes", async ({ p
13
13
  });
14
14
  fixtures_1.test.skip("computer use agent generates code for google login", async ({ page, }) => {
15
15
  await page.goto(`https://dash.empirical.run`);
16
- const result = await (0, run_1.createTestUsingComputerUseAgent)({
16
+ const result = await (0, cua_1.createTestUsingComputerUseAgent)({
17
17
  page,
18
18
  task: `Click on the "Sign in with Google" button and enter dpdzero-test-user@empirical.run
19
19
  as the email and click continue. then enter password as 1234556789`,
@@ -1,81 +1,11 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const fs_1 = __importDefault(require("fs"));
7
- const path_1 = __importDefault(require("path"));
8
- const utils_1 = require("../../browsing/utils");
9
- const element_annotation_1 = require("../element-annotation");
10
- const run_1 = require("../run");
3
+ const cua_1 = require("@empiricalrun/cua");
11
4
  const fixtures_1 = require("./fixtures");
12
- fixtures_1.test.skip("able to scroll and interact with elements", async ({ page, server, }) => {
13
- await page.goto(`${server.baseURL}/blog-page.html`);
14
- const response = await (0, run_1.createTestUsingMasterAgent)({
15
- task: `fill test@test.com into the email field and click the submit`,
16
- page,
17
- options: {},
18
- });
19
- console.log(response);
20
- (0, fixtures_1.expect)(response.importPaths.length).toBe(0);
21
- (0, fixtures_1.expect)(response.code).toContain("await page.getByPlaceholder('Enter your email').fill(\"test@test.com\")");
22
- (0, fixtures_1.expect)(response.code).toContain("await page.getByRole('button', { name: 'Subscribe' }).click()");
23
- });
24
- fixtures_1.test.skip("scroll when element does not exist", async ({ page, server }) => {
25
- await page.goto(`${server.baseURL}/blog-page.html`);
26
- const response = await (0, run_1.createTestUsingMasterAgent)({
27
- task: `click search button`,
28
- page,
29
- options: {},
30
- });
31
- console.log(response);
32
- (0, fixtures_1.expect)(response.importPaths.length).toBe(0);
33
- (0, fixtures_1.expect)(response.code.length).toBe(0);
34
- });
35
- fixtures_1.test.skip("scroll and click inside div elements", async ({ page, server }) => {
36
- await page.goto(`${server.baseURL}/dropdown-scrolls.html`);
37
- const response = await (0, run_1.createTestUsingMasterAgent)({
38
- task: `click on x-3 inside bmw dropdown, and then,
39
- click on maverick inside ford dropdown`,
40
- page,
41
- options: {},
42
- });
43
- console.log(response);
44
- (0, fixtures_1.expect)(response.importPaths.length).toBe(0);
45
- (0, fixtures_1.expect)(response.code.length).toBeGreaterThan(0);
46
- const lines = response.code.split("\n");
47
- (0, fixtures_1.expect)(lines.find((l) => l.match(/^await page.+BMW.+.click/))).toBeTruthy();
48
- (0, fixtures_1.expect)(lines.find((l) => l.match(/^await page.+X3.+.click/))).toBeTruthy();
49
- (0, fixtures_1.expect)(lines.find((l) => l.match(/^await page.+Ford.+.click/))).toBeTruthy();
50
- (0, fixtures_1.expect)(lines.find((l) => l.match(/^await page.+Maverick.+.click/))).toBeTruthy();
51
- });
52
- fixtures_1.test.skip("master agent can click icons accurately", async ({ page, server, }) => {
53
- await page.goto(`${server.baseURL}/icons-navbar.html`);
54
- await (0, fixtures_1.expect)(page.getByText("select an icon")).toBeVisible();
55
- const response = await (0, run_1.createTestUsingMasterAgent)({
56
- task: `click on the gear icon`,
57
- page,
58
- options: {},
59
- });
60
- // Validate code generated and action performed
61
- await (0, fixtures_1.expect)(page.getByText("you clicked Gear")).toBeVisible();
62
- console.log(response);
63
- (0, fixtures_1.expect)(response.importPaths.length).toBe(0);
64
- (0, fixtures_1.expect)(response.code).toContain("page.locator");
65
- (0, fixtures_1.expect)(response.code).toContain("click()");
66
- // Validate icons registry
67
- const iconsRegistryFile = path_1.default.join(process.cwd(), ".empiricalrun", "icons.json");
68
- const icons = JSON.parse(fs_1.default.readFileSync(iconsRegistryFile, "utf-8"));
69
- (0, fixtures_1.expect)(icons.length).toBeGreaterThan(0);
70
- // Commenting out this check since with parallel test executions,
71
- // we can have icons from other tests in the same file
72
- // expect(icons.length).toBe(4); // 1 for each unique icon
73
- fs_1.default.unlinkSync(iconsRegistryFile);
74
- });
75
5
  fixtures_1.test.skip("cua agent can click icons accurately", async ({ page, server }) => {
76
6
  await page.goto(`${server.baseURL}/icons-navbar.html`);
77
7
  await (0, fixtures_1.expect)(page.getByText("select an icon")).toBeVisible();
78
- const response = await (0, run_1.createTestUsingComputerUseAgent)({
8
+ const response = await (0, cua_1.createTestUsingComputerUseAgent)({
79
9
  task: `click on the gear icon`,
80
10
  page,
81
11
  });
@@ -86,42 +16,3 @@ fixtures_1.test.skip("cua agent can click icons accurately", async ({ page, serv
86
16
  (0, fixtures_1.expect)(response.code).toContain("page.locator");
87
17
  (0, fixtures_1.expect)(response.code).toContain("click()");
88
18
  });
89
- fixtures_1.test.skip("annotate and enrich annotations correctly", async ({ page, server, }) => {
90
- await (0, utils_1.injectPwLocatorGenerator)(page);
91
- await page.goto(`${server.baseURL}/iframe-elements.html`);
92
- const { annotationKeys: keys } = await (0, element_annotation_1.getAnnotationKeys)({
93
- page,
94
- preference: {
95
- actionType: "all",
96
- },
97
- });
98
- console.log(keys);
99
- (0, fixtures_1.expect)(keys.length).toBe(6);
100
- // 2 icons: 1 in main frame, 1 in iframe
101
- (0, fixtures_1.expect)(keys.filter((k) => k.text.includes("icon") && k.text.includes("close"))
102
- .length).toBe(2);
103
- // 2 text inputs: 1 in main frame, 1 in iframe
104
- (0, fixtures_1.expect)(keys.filter((k) => k.text.includes("Enter your name")).length).toBe(2);
105
- // 2 clickable divs: 1 in main frame, 1 in iframe
106
- (0, fixtures_1.expect)(keys.filter((k) => k.text.includes("Lorem Ipsum")).length).toBe(2);
107
- });
108
- fixtures_1.test.skip("fill action with multiple pages", async ({ context }) => {
109
- const page1 = await context.newPage();
110
- const page2 = await context.newPage();
111
- const response = await (0, run_1.createTestUsingMasterAgent)({
112
- task: `goto empirical.run on page1 and goto github.com/search in page2. Enter text empirical on page2 and click on search.`,
113
- page: page2,
114
- options: {},
115
- scopeVars: {
116
- context,
117
- page1,
118
- page2,
119
- },
120
- });
121
- (0, fixtures_1.expect)(response.code).toBeTruthy();
122
- console.log(response.code);
123
- const lines = response.code.split("\n");
124
- (0, fixtures_1.expect)(lines.find((l) => l.match(/^await page1\.goto(.+)empirical\.run/))).toBeTruthy();
125
- (0, fixtures_1.expect)(lines.find((l) => l.match(/^await page2\.goto(.+)github\.com\/search/))).toBeTruthy();
126
- (0, fixtures_1.expect)(lines.find((l) => l.match(/^await page2(.+)fill(.+)empirical/))).toBeTruthy();
127
- });
@@ -2,7 +2,6 @@ import type { TestGenConfigOptions } from "@empiricalrun/shared-types/agent-work
2
2
  import type { TestCaseWithSuitesAsArray } from "@empiricalrun/shared-types/api/test-cases";
3
3
  import { Page } from "playwright";
4
4
  import { ScopeVars } from "../../types";
5
- export { createTestUsingComputerUseAgent } from "../cua";
6
5
  export declare const IS_ALLOWED_TO_USE_SKILLS = false;
7
6
  export declare function createTestUsingMasterAgent({ task, page, testCase, specPath, options, scopeVars, }: {
8
7
  task: string;
@@ -1 +1 @@
1
- {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/agent/master/run.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACtF,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAC;AAC3F,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAYlC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAQxC,OAAO,EAAE,+BAA+B,EAAE,MAAM,QAAQ,CAAC;AAKzD,eAAO,MAAM,wBAAwB,QAAQ,CAAC;AAqB9C,wBAAsB,0BAA0B,CAAC,EAC/C,IAAI,EACJ,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,SAAS,GACV,EAAE;IACD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,IAAI,CAAC;IACX,QAAQ,CAAC,EAAE,yBAAyB,CAAC;IACrC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAAC;IACvC,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;;;GAwJA"}
1
+ {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/agent/master/run.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACtF,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAC;AAC3F,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAYlC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAWxC,eAAO,MAAM,wBAAwB,QAAQ,CAAC;AAqB9C,wBAAsB,0BAA0B,CAAC,EAC/C,IAAI,EACJ,IAAI,EACJ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