@empiricalrun/test-gen 0.79.3 → 0.79.5

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 (180) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/agent/browsing/run.d.ts +1 -1
  3. package/dist/agent/browsing/run.d.ts.map +1 -1
  4. package/dist/agent/browsing/utils.d.ts +0 -7
  5. package/dist/agent/browsing/utils.d.ts.map +1 -1
  6. package/dist/agent/browsing/utils.js +1 -56
  7. package/dist/agent/chat/index.d.ts.map +1 -1
  8. package/dist/agent/chat/index.js +21 -2
  9. package/dist/agent/chat/prompt/pw-utils-docs.d.ts +1 -1
  10. package/dist/agent/chat/prompt/pw-utils-docs.d.ts.map +1 -1
  11. package/dist/agent/chat/prompt/pw-utils-docs.js +1 -1
  12. package/dist/agent/chat/prompt/trace-utils-docs.d.ts +2 -0
  13. package/dist/agent/chat/prompt/trace-utils-docs.d.ts.map +1 -0
  14. package/dist/agent/chat/prompt/trace-utils-docs.js +208 -0
  15. package/dist/agent/code-review/index.d.ts +1 -1
  16. package/dist/agent/code-review/index.d.ts.map +1 -1
  17. package/dist/agent/code-review/index.js +4 -4
  18. package/dist/agent/code-review/{parser.d.ts → xml-parser.d.ts} +1 -1
  19. package/dist/agent/code-review/xml-parser.d.ts.map +1 -0
  20. package/dist/agent/code-review/{parser.js → xml-parser.js} +1 -1
  21. package/dist/agent/fast-triage/index.d.ts.map +1 -1
  22. package/dist/agent/fast-triage/index.js +31 -3
  23. package/dist/agent/master/element-annotation.d.ts.map +1 -1
  24. package/dist/agent/master/element-annotation.js +2 -19
  25. package/dist/agent/master/run.d.ts +1 -1
  26. package/dist/agent/master/run.d.ts.map +1 -1
  27. package/dist/agent/master/run.js +1 -1
  28. package/dist/bin/index.js +0 -2
  29. package/dist/constants/index.d.ts +1 -1
  30. package/dist/constants/index.js +1 -1
  31. package/dist/dashboard/client.d.ts +2 -40
  32. package/dist/dashboard/client.d.ts.map +1 -1
  33. package/dist/dashboard/client.js +4 -206
  34. package/dist/dashboard/index.d.ts +2 -3
  35. package/dist/dashboard/index.d.ts.map +1 -1
  36. package/dist/dashboard/index.js +10 -10
  37. package/dist/dashboard/tool-response-from-sandbox.d.ts +2 -0
  38. package/dist/dashboard/tool-response-from-sandbox.d.ts.map +1 -0
  39. package/dist/dashboard/tool-response-from-sandbox.js +6 -0
  40. package/dist/dashboard/tool-response.d.ts +1 -4
  41. package/dist/dashboard/tool-response.d.ts.map +1 -1
  42. package/dist/dashboard/tool-response.js +5 -86
  43. package/dist/dashboard/types.d.ts +1 -8
  44. package/dist/dashboard/types.d.ts.map +1 -1
  45. package/dist/dashboard/types.js +4 -14
  46. package/dist/file/server.d.ts +1 -1
  47. package/dist/file/server.d.ts.map +1 -1
  48. package/dist/file-info/adapters/github/reader.d.ts.map +1 -1
  49. package/dist/file-info/adapters/github/reader.js +9 -3
  50. package/dist/generate-summary/generate-error-stack-summary.js +1 -4
  51. package/dist/generate-summary/generate-failed-step-screenshot-diff-summary.d.ts.map +1 -1
  52. package/dist/generate-summary/generate-failed-step-screenshot-diff-summary.js +8 -8
  53. package/dist/generate-summary/generate-grouped-summary.js +1 -4
  54. package/dist/generate-summary/merge-summary.js +1 -4
  55. package/dist/index.d.ts.map +1 -1
  56. package/dist/index.js +3 -3
  57. package/dist/recorder/index.d.ts.map +1 -1
  58. package/dist/recorder/index.js +2 -2
  59. package/dist/telemetry/index.d.ts +3 -3
  60. package/dist/telemetry/index.d.ts.map +1 -1
  61. package/dist/telemetry/index.js +8 -5
  62. package/dist/tools/analyse-video/index.js +1 -1
  63. package/dist/tools/definitions/publish-markdown-report.d.ts +8 -0
  64. package/dist/tools/definitions/publish-markdown-report.d.ts.map +1 -0
  65. package/dist/tools/definitions/publish-markdown-report.js +29 -0
  66. package/dist/tools/diagnosis-fetcher.d.ts +5 -0
  67. package/dist/tools/diagnosis-fetcher.d.ts.map +1 -1
  68. package/dist/tools/diagnosis-fetcher.js +17 -12
  69. package/dist/tools/executor/index.d.ts.map +1 -1
  70. package/dist/tools/executor/index.js +2 -2
  71. package/dist/tools/fetch-file/index.d.ts.map +1 -1
  72. package/dist/tools/fetch-file/index.js +11 -10
  73. package/dist/tools/fetch-file/utils.d.ts +13 -1
  74. package/dist/tools/fetch-file/utils.d.ts.map +1 -1
  75. package/dist/tools/fetch-file/utils.js +44 -118
  76. package/dist/tools/index.d.ts +1 -1
  77. package/dist/tools/index.d.ts.map +1 -1
  78. package/dist/tools/index.js +9 -5
  79. package/dist/tools/issues-v1/index.d.ts +0 -2
  80. package/dist/tools/issues-v1/index.d.ts.map +1 -1
  81. package/dist/tools/issues-v1/index.js +1 -5
  82. package/dist/tools/publish-markdown-report/index.d.ts +3 -0
  83. package/dist/tools/publish-markdown-report/index.d.ts.map +1 -0
  84. package/dist/tools/publish-markdown-report/index.js +196 -0
  85. package/dist/tools/test-gen-browser.d.ts.map +1 -1
  86. package/dist/tools/test-gen-browser.js +4 -4
  87. package/dist/tools/trace-dot-zip/index.d.ts.map +1 -1
  88. package/dist/tools/trace-dot-zip/index.js +19 -9
  89. package/dist/utils/model.d.ts.map +1 -1
  90. package/dist/utils/model.js +2 -6
  91. package/package.json +4 -11
  92. package/tsconfig.tsbuildinfo +1 -1
  93. package/dist/agent/code-review/parser.d.ts.map +0 -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/agent/master/icon-descriptor/index.d.ts +0 -22
  140. package/dist/agent/master/icon-descriptor/index.d.ts.map +0 -1
  141. package/dist/agent/master/icon-descriptor/index.js +0 -249
  142. package/dist/agent/master/icon-descriptor/normalize-svg.d.ts +0 -2
  143. package/dist/agent/master/icon-descriptor/normalize-svg.d.ts.map +0 -1
  144. package/dist/agent/master/icon-descriptor/normalize-svg.js +0 -247
  145. package/dist/tools/issues-v1/create-issue.d.ts +0 -3
  146. package/dist/tools/issues-v1/create-issue.d.ts.map +0 -1
  147. package/dist/tools/issues-v1/create-issue.js +0 -72
  148. package/dist/tools/issues-v1/update-issue.d.ts +0 -3
  149. package/dist/tools/issues-v1/update-issue.d.ts.map +0 -1
  150. package/dist/tools/issues-v1/update-issue.js +0 -74
  151. package/dist/trace-utils/cli.d.ts +0 -3
  152. package/dist/trace-utils/cli.d.ts.map +0 -1
  153. package/dist/trace-utils/cli.js +0 -302
  154. package/dist/trace-utils/console.d.ts +0 -11
  155. package/dist/trace-utils/console.d.ts.map +0 -1
  156. package/dist/trace-utils/console.js +0 -74
  157. package/dist/trace-utils/dom-snapshot.d.ts +0 -19
  158. package/dist/trace-utils/dom-snapshot.d.ts.map +0 -1
  159. package/dist/trace-utils/dom-snapshot.js +0 -328
  160. package/dist/trace-utils/index.d.ts +0 -12
  161. package/dist/trace-utils/index.d.ts.map +0 -1
  162. package/dist/trace-utils/index.js +0 -28
  163. package/dist/trace-utils/network.d.ts +0 -16
  164. package/dist/trace-utils/network.d.ts.map +0 -1
  165. package/dist/trace-utils/network.js +0 -178
  166. package/dist/trace-utils/normalize-trace-url.d.ts +0 -2
  167. package/dist/trace-utils/normalize-trace-url.d.ts.map +0 -1
  168. package/dist/trace-utils/normalize-trace-url.js +0 -15
  169. package/dist/trace-utils/screenshots.d.ts +0 -24
  170. package/dist/trace-utils/screenshots.d.ts.map +0 -1
  171. package/dist/trace-utils/screenshots.js +0 -197
  172. package/dist/trace-utils/steps.d.ts +0 -10
  173. package/dist/trace-utils/steps.d.ts.map +0 -1
  174. package/dist/trace-utils/steps.js +0 -126
  175. package/dist/trace-utils/types.d.ts +0 -51
  176. package/dist/trace-utils/types.d.ts.map +0 -1
  177. package/dist/trace-utils/types.js +0 -2
  178. package/dist/utils/playwright-report-parser.d.ts +0 -2
  179. package/dist/utils/playwright-report-parser.d.ts.map +0 -1
  180. package/dist/utils/playwright-report-parser.js +0 -10
@@ -1 +1 @@
1
- {"version":3,"file":"element-annotation.d.ts","sourceRoot":"","sources":["../../../src/agent/master/element-annotation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,GAAG,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAQlC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AA2DjD,wBAAsB,oBAAoB,CAAC,EACzC,kBAAkB,EAClB,WAAW,EACX,mBAAmB,EACnB,KAAK,EACL,GAAG,EACH,OAAO,EACP,UAAU,GACX,EAAE;IACD,kBAAkB,EAAE,MAAM,CAAC;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,GAAG,CAAC,EAAE,GAAG,CAAC;IACV,OAAO,CAAC,EAAE,oBAAoB,CAAC;IAC/B,UAAU,EAAE,oBAAoB,CAAC;CAClC,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CA8C9B;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,UAAU,EACN,KAAK,GACL,UAAU,CAAC,IAAI,GACf,UAAU,CAAC,WAAW,GACtB,UAAU,CAAC,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACpC,CAAC;AAgBF,wBAAsB,iBAAiB,CAAC,EACtC,IAAI,EACJ,UAAU,EACV,KAAK,GACN,EAAE;IACD,IAAI,EAAE,IAAI,CAAC;IACX,UAAU,EAAE,oBAAoB,CAAC;IACjC,KAAK,CAAC,EAAE,WAAW,CAAC;CACrB,GAAG,OAAO,CAAC;IACV,cAAc,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACtD,gBAAgB,EAAE,MAAM,CAAC;IACzB,uBAAuB,EAAE,MAAM,CAAC;CACjC,CAAC,CAmFD"}
1
+ {"version":3,"file":"element-annotation.d.ts","sourceRoot":"","sources":["../../../src/agent/master/element-annotation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,GAAG,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAQlC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AA0DjD,wBAAsB,oBAAoB,CAAC,EACzC,kBAAkB,EAClB,WAAW,EACX,mBAAmB,EACnB,KAAK,EACL,GAAG,EACH,OAAO,EACP,UAAU,GACX,EAAE;IACD,kBAAkB,EAAE,MAAM,CAAC;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,GAAG,CAAC,EAAE,GAAG,CAAC;IACV,OAAO,CAAC,EAAE,oBAAoB,CAAC;IAC/B,UAAU,EAAE,oBAAoB,CAAC;CAClC,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CA8C9B;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,UAAU,EACN,KAAK,GACL,UAAU,CAAC,IAAI,GACf,UAAU,CAAC,WAAW,GACtB,UAAU,CAAC,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACpC,CAAC;AAgBF,wBAAsB,iBAAiB,CAAC,EACtC,IAAI,EACJ,UAAU,EACV,KAAK,GACN,EAAE;IACD,IAAI,EAAE,IAAI,CAAC;IACX,UAAU,EAAE,oBAAoB,CAAC;IACjC,KAAK,CAAC,EAAE,WAAW,CAAC;CACrB,GAAG,OAAO,CAAC;IACV,cAAc,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACtD,gBAAgB,EAAE,MAAM,CAAC;IACzB,uBAAuB,EAAE,MAAM,CAAC;CACjC,CAAC,CAmFD"}
@@ -5,7 +5,6 @@ exports.getAnnotationKeys = getAnnotationKeys;
5
5
  const llm_1 = require("@empiricalrun/llm");
6
6
  const constants_1 = require("../../constants");
7
7
  const promptTemplate_0 = "{{#section \"system\"}}\nYou are an expert in describing the images and it's content. You need to provide the descriptions of annotated elements\npresent in the image.\n\nYou will be provided with an annotated screenshot where interact-able / clickable elements are annotated. The annotation\nis done by drawing a red box around the element and a small yellow box on it which contains unique element id.\n\nYou are given a Annotations which contains list of unique element id and description of the element separated by \":\".\n\nYou are also given the description of the element on which the action needs to be taken. The description includes\ninformation about how the element looks, it's position etc.\n\nYour task is to provide the annotation of the element on which the action needs to be performed based on the element\ndescription.\n\nFollow steps to fulfil your task:\n- Using the list of all element Ids provided to you, map all the element Ids on the annotated screen and describe each\nelement.\n- For describing each element Id\n-- iterate over each element Id in annotation list\n-- check if the description is already present for the element Id in the Annotation provided to you. If present skip\ndescribing it and use it as is.\n-- if the description is NA, then identify the element in the annotated screenshot and describe it using the image or\nicon enclosed in the element.\n- Respond with the mapped element Ids as \"enriched_annotations\"\n- Based on the description provided to you and the enriched annotations, first identify the element Id whose description\nmatches the task provided\n\nNote:\n- Ensure providing the description of all the elements in the list.\n- Don't update the description if its already present in the given annotations\n- Replace all the \"NA\" with description of the element. Its position, how does it look like etc.\n- There should be no \"NA\" present in any of the element description\n{{/section}}\n\n{{#section \"user\"}}\nElement description:\n{{elementDescription}}\n\nAnnotations:\n{{annotations}}\n\n{{image annotatedScreenshot}}\n{{/section}}";
8
- const icon_descriptor_1 = require("./icon-descriptor");
9
8
  const annotationToolAction = {
10
9
  name: "element_annotation",
11
10
  schema: {
@@ -163,29 +162,13 @@ async function getAnnotationKeys({ page, preference, trace, }) {
163
162
  annotatedPageScreenshot,
164
163
  };
165
164
  }
166
- async function enrichAnnotations(annotatedElements, pageHtml, trace) {
167
- // create icon descriptor span
168
- const iconDescriptionSpan = trace?.span({
169
- name: "describe-icons",
170
- });
165
+ async function enrichAnnotations(annotatedElements, _pageHtml, _trace) {
171
166
  const results = [];
172
167
  for (const element of annotatedElements) {
173
168
  const text = element.innerText?.trim() || element.placeholder?.trim();
174
- if (text) {
175
- results.push({
176
- elementID: element.elementID,
177
- text,
178
- });
179
- continue;
180
- }
181
- const description = await (0, icon_descriptor_1.getIconDescription)({
182
- htmlString: element.outerHTML,
183
- pageHtml: pageHtml,
184
- trace: iconDescriptionSpan,
185
- });
186
169
  results.push({
187
170
  elementID: element.elementID,
188
- text: description || "NA",
171
+ text: text || "NA",
189
172
  });
190
173
  }
191
174
  return results;
@@ -2,7 +2,7 @@ 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";
5
+ export { createTestUsingComputerUseAgent } from "@empiricalrun/cua";
6
6
  export declare const IS_ALLOWED_TO_USE_SKILLS = false;
7
7
  export declare function createTestUsingMasterAgent({ task, page, testCase, specPath, options, scopeVars, }: {
8
8
  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;AAQxC,OAAO,EAAE,+BAA+B,EAAE,MAAM,mBAAmB,CAAC;AAKpE,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"}
@@ -15,7 +15,7 @@ const run_time_planner_1 = require("../planner/run-time-planner");
15
15
  const action_tool_calls_1 = require("./action-tool-calls");
16
16
  const execute_browser_action_1 = require("./execute-browser-action");
17
17
  const next_action_1 = require("./next-action");
18
- var cua_1 = require("../cua");
18
+ var cua_1 = require("@empiricalrun/cua");
19
19
  Object.defineProperty(exports, "createTestUsingComputerUseAgent", { enumerable: true, get: function () { return cua_1.createTestUsingComputerUseAgent; } });
20
20
  const MAX_ERROR_COUNT = 2;
21
21
  // Disabling skills as we're seeing false usage with chat agent
package/dist/bin/index.js CHANGED
@@ -14,7 +14,6 @@ const client_1 = require("../dashboard/client");
14
14
  const recorder_1 = require("../recorder");
15
15
  const validation_1 = require("../recorder/validation");
16
16
  const test_build_1 = require("../test-build");
17
- const cli_2 = require("../trace-utils/cli");
18
17
  const environments_1 = require("./environments");
19
18
  const setup_1 = require("./setup");
20
19
  const utils_1 = require("./utils");
@@ -226,7 +225,6 @@ async function main() {
226
225
  }
227
226
  process.exit(0);
228
227
  });
229
- program.addCommand((0, cli_2.buildTraceUtilsCommand)());
230
228
  program.parse(process.argv);
231
229
  }
232
230
  main().catch((error) => {
@@ -6,7 +6,7 @@ export declare const DEFAULT_MODEL_PARAMETERS: ModelParameters;
6
6
  export declare const DEFAULT_O1_MODEL_PARAMETERS: ModelParameters;
7
7
  export declare const VIDEO_ANALYSIS: {
8
8
  readonly FRAME_INDEX_PADDING: 6;
9
- readonly DEFAULT_MODEL: "claude-sonnet-4-20250514";
9
+ readonly DEFAULT_MODEL: "claude-sonnet-4-6";
10
10
  readonly DEFAULT_FPS: 25;
11
11
  readonly DEFAULT_THRESHOLD: 0.01;
12
12
  readonly DEFAULT_FALLBACK_FPS: 30;
@@ -21,7 +21,7 @@ exports.VIDEO_ANALYSIS = {
21
21
  // Frame processing
22
22
  FRAME_INDEX_PADDING: 6,
23
23
  // Default analysis parameters
24
- DEFAULT_MODEL: "claude-sonnet-4-20250514",
24
+ DEFAULT_MODEL: "claude-sonnet-4-6",
25
25
  DEFAULT_FPS: 25,
26
26
  DEFAULT_THRESHOLD: 0.01,
27
27
  DEFAULT_FALLBACK_FPS: 30,
@@ -1,41 +1,3 @@
1
- import { IDashboardAPIClient, RequestOptions } from "@empiricalrun/shared-types/api/base";
2
- export type AuthenticationType = "user-access-token" | "project-api-key" | "admin-totp";
3
- export type TokenProvider = () => Promise<{
4
- access_token: string;
5
- refresh_token: string;
6
- expires_at: number;
7
- user_id?: string;
8
- user_email?: string;
9
- } | null>;
10
- export declare class DashboardAPIClient implements IDashboardAPIClient {
11
- private baseUrl;
12
- private authType;
13
- private projectApiKey?;
14
- private secretKey?;
15
- private tokenProvider?;
16
- constructor({ authType, projectApiKey, secretKey, baseUrl, tokenProvider, }: {
17
- authType: AuthenticationType;
18
- projectApiKey?: string;
19
- secretKey?: string;
20
- baseUrl?: string;
21
- tokenProvider?: TokenProvider;
22
- });
23
- private getTokens;
24
- request<T>(endpoint: string, options: RequestOptions): Promise<T>;
25
- callGitHubProxy<T>({ method, url, body, }: {
26
- method: "GET" | "POST" | "PATCH" | "PUT" | "DELETE";
27
- url: string;
28
- body?: any;
29
- }): Promise<T>;
30
- callMailosaurProxy<T>({ method, path, body, }: {
31
- method: "GET" | "POST" | "PATCH" | "PUT" | "DELETE";
32
- path: string;
33
- body?: any;
34
- }): Promise<T>;
35
- getBaseUrl(): string;
36
- ensureUserIsAuthenticated(): Promise<void>;
37
- private _makeRequest;
38
- private refreshUserToken;
39
- }
40
- export declare const apiClient: DashboardAPIClient;
1
+ export type { AuthenticationType, TokenProvider, } from "@empiricalrun/dashboard-client";
2
+ export { apiClient, DashboardAPIClient } from "@empiricalrun/dashboard-client";
41
3
  //# sourceMappingURL=client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/dashboard/client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,cAAc,EACf,MAAM,qCAAqC,CAAC;AAY7C,MAAM,MAAM,kBAAkB,GAC1B,mBAAmB,GACnB,iBAAiB,GACjB,YAAY,CAAC;AAEjB,MAAM,MAAM,aAAa,GAAG,MAAM,OAAO,CAAC;IACxC,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,GAAG,IAAI,CAAC,CAAC;AAEV,qBAAa,kBAAmB,YAAW,mBAAmB;IAC5D,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,QAAQ,CAAqB;IACrC,OAAO,CAAC,aAAa,CAAC,CAAS;IAC/B,OAAO,CAAC,SAAS,CAAC,CAAS;IAC3B,OAAO,CAAC,aAAa,CAAC,CAAgB;gBAE1B,EACV,QAAQ,EACR,aAAa,EACb,SAAS,EACT,OAAO,EACP,aAAa,GACd,EAAE;QACD,QAAQ,EAAE,kBAAkB,CAAC;QAC7B,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,aAAa,CAAC,EAAE,aAAa,CAAC;KAC/B;YAwBa,SAAS;IAOjB,OAAO,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,CAAC,CAAC;IA+CjE,eAAe,CAAC,CAAC,EAAE,EACvB,MAAM,EACN,GAAG,EACH,IAAI,GACL,EAAE;QACD,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,GAAG,QAAQ,CAAC;QACpD,GAAG,EAAE,MAAM,CAAC;QACZ,IAAI,CAAC,EAAE,GAAG,CAAC;KACZ,GAAG,OAAO,CAAC,CAAC,CAAC;IAYR,kBAAkB,CAAC,CAAC,EAAE,EAC1B,MAAM,EACN,IAAI,EACJ,IAAI,GACL,EAAE;QACD,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,GAAG,QAAQ,CAAC;QACpD,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,CAAC,EAAE,GAAG,CAAC;KACZ,GAAG,OAAO,CAAC,CAAC,CAAC;IAYd,UAAU,IAAI,MAAM;IAId,yBAAyB,IAAI,OAAO,CAAC,IAAI,CAAC;YAmBlC,YAAY;YAoDZ,gBAAgB;CAyC/B;AAED,eAAO,MAAM,SAAS,oBAEpB,CAAC"}
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/dashboard/client.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,kBAAkB,EAClB,aAAa,GACd,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC"}
@@ -1,208 +1,6 @@
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
- exports.apiClient = exports.DashboardAPIClient = void 0;
7
- const async_retry_1 = __importDefault(require("async-retry"));
8
- const token_store_1 = require("../auth/token-store");
9
- const logger_1 = require("../logger");
10
- const totp_1 = require("./totp");
11
- const types_1 = require("./types");
12
- class DashboardAPIClient {
13
- baseUrl;
14
- authType;
15
- projectApiKey;
16
- secretKey;
17
- tokenProvider;
18
- constructor({ authType, projectApiKey, secretKey, baseUrl, tokenProvider, }) {
19
- this.baseUrl =
20
- baseUrl || process.env.DASHBOARD_DOMAIN || "https://dash.empirical.run";
21
- this.authType = authType;
22
- if (this.authType === "project-api-key") {
23
- if (!projectApiKey && !process.env.EMPIRICALRUN_API_KEY) {
24
- throw new Error("Project API key is required when authentication type is 'project-api-key'");
25
- }
26
- this.projectApiKey = projectApiKey || process.env.EMPIRICALRUN_API_KEY;
27
- }
28
- else if (this.authType === "admin-totp") {
29
- if (!secretKey && !process.env.EMPIRICAL_TOTP_SK) {
30
- throw new Error("Secret key is required when authentication type is 'admin-totp'");
31
- }
32
- this.secretKey = secretKey || process.env.EMPIRICAL_TOTP_SK;
33
- }
34
- this.tokenProvider = tokenProvider;
35
- }
36
- async getTokens() {
37
- if (this.tokenProvider) {
38
- return this.tokenProvider();
39
- }
40
- return (0, token_store_1.getStoredUserTokens)();
41
- }
42
- async request(endpoint, options) {
43
- let response;
44
- if (this.secretKey) {
45
- const secretKey = this.secretKey;
46
- response = await this._makeRequest(endpoint, options, async () => ({
47
- "X-Empirical-Auth-TOTP": await (0, totp_1.getTOTP)(secretKey),
48
- }));
49
- }
50
- else if (this.projectApiKey) {
51
- response = await this._makeRequest(endpoint, options, async () => ({
52
- Authorization: `Bearer ${this.projectApiKey}`,
53
- }));
54
- }
55
- else {
56
- await this.ensureUserIsAuthenticated();
57
- const tokens = await this.getTokens();
58
- if (!tokens) {
59
- throw new Error("Not authenticated. Please run the login command first.");
60
- }
61
- response = await this._makeRequest(endpoint, options, async () => ({
62
- Authorization: `Bearer ${tokens.access_token}`,
63
- }));
64
- if (response && response.status === 401) {
65
- logger_1.logger.debug("Access token expired, attempting to refresh...");
66
- const refreshed = await this.refreshUserToken();
67
- if (refreshed) {
68
- const newTokens = await this.getTokens();
69
- if (newTokens) {
70
- response = this._makeRequest(endpoint, options, async () => ({
71
- Authorization: `Bearer ${newTokens.access_token}`,
72
- }));
73
- }
74
- }
75
- throw new Error("Authentication failed. Please run the login command again.");
76
- }
77
- }
78
- if (!response) {
79
- throw new Error("No response received from the API");
80
- }
81
- return response.json();
82
- }
83
- async callGitHubProxy({ method, url, body, }) {
84
- const requestBody = {
85
- method,
86
- url,
87
- body,
88
- };
89
- return await this.request(`/api/github/proxy`, {
90
- method: "POST",
91
- body: requestBody,
92
- });
93
- }
94
- async callMailosaurProxy({ method, path, body, }) {
95
- const requestBody = {
96
- method,
97
- path,
98
- body,
99
- };
100
- return await this.request(`/api/mailosaur/proxy`, {
101
- method: "POST",
102
- body: requestBody,
103
- });
104
- }
105
- getBaseUrl() {
106
- return this.baseUrl;
107
- }
108
- async ensureUserIsAuthenticated() {
109
- const tokens = await this.getTokens();
110
- if (!tokens) {
111
- throw new Error("Not authenticated. Please run the login command first.");
112
- }
113
- // Check if token is expired (with 5 minute buffer)
114
- const expirationBuffer = 5 * 60;
115
- const now = Math.floor(Date.now() / 1000);
116
- const isExpired = tokens.expires_at <= now + expirationBuffer;
117
- if (isExpired && !this.tokenProvider) {
118
- // Only attempt refresh if using file-based token store
119
- const refreshed = await this.refreshUserToken();
120
- if (!refreshed) {
121
- throw new Error("Session expired. Please run the login command again.");
122
- }
123
- }
124
- }
125
- async _makeRequest(endpoint, options, getAuthHeader) {
126
- const method = options.method || "GET";
127
- const url = new URL(endpoint, this.baseUrl);
128
- if (options.params) {
129
- Object.entries(options.params).forEach(([key, value]) => {
130
- url.searchParams.append(key, value);
131
- });
132
- }
133
- return await (0, async_retry_1.default)(async (bail) => {
134
- const authHeader = await getAuthHeader();
135
- const headers = {
136
- ...authHeader,
137
- "Content-Type": "application/json",
138
- "User-Agent": "@empiricalrun/test-gen",
139
- };
140
- const response = await fetch(url, {
141
- headers,
142
- method: method,
143
- body: options.body ? JSON.stringify(options.body) : undefined,
144
- });
145
- if (!response.ok) {
146
- let error;
147
- const msg = `HTTP error in ${method} request to ${url}! Status code: ${response.status}. Response: ${await response.text()}`;
148
- if (response.status < 500) {
149
- error = new types_1.NonRetryableHTTPError(msg, response.status);
150
- bail(error);
151
- return;
152
- }
153
- else {
154
- error = new types_1.RetryableHTTPError(msg, response.status);
155
- }
156
- throw error;
157
- }
158
- return response;
159
- }, {
160
- retries: 3,
161
- factor: 2,
162
- minTimeout: 1_000,
163
- maxTimeout: 5_000,
164
- });
165
- }
166
- async refreshUserToken() {
167
- const tokens = await this.getTokens();
168
- if (!tokens || !tokens.refresh_token) {
169
- return false;
170
- }
171
- try {
172
- const response = await fetch(`${this.baseUrl}/api/cli/refresh`, {
173
- method: "POST",
174
- headers: {
175
- "Content-Type": "application/json",
176
- },
177
- body: JSON.stringify({
178
- refresh_token: tokens.refresh_token,
179
- }),
180
- });
181
- if (!response.ok) {
182
- const errorText = await response.text();
183
- console.error("Token refresh failed:", errorText);
184
- await (0, token_store_1.clearTokens)();
185
- return false;
186
- }
187
- const data = await response.json();
188
- await (0, token_store_1.storeTokens)({
189
- access_token: data.access_token,
190
- refresh_token: data.refresh_token,
191
- expires_at: data.expires_at,
192
- user_id: data.user?.id || tokens.user_id,
193
- user_email: data.user?.email || tokens.user_email,
194
- });
195
- logger_1.logger.debug("Access token refreshed successfully via dashboard");
196
- return true;
197
- }
198
- catch (error) {
199
- console.error("Token refresh error:", error);
200
- await (0, token_store_1.clearTokens)();
201
- return false;
202
- }
203
- }
204
- }
205
- exports.DashboardAPIClient = DashboardAPIClient;
206
- exports.apiClient = new DashboardAPIClient({
207
- authType: "user-access-token",
208
- });
3
+ exports.DashboardAPIClient = exports.apiClient = void 0;
4
+ var dashboard_client_1 = require("@empiricalrun/dashboard-client");
5
+ Object.defineProperty(exports, "apiClient", { enumerable: true, get: function () { return dashboard_client_1.apiClient; } });
6
+ Object.defineProperty(exports, "DashboardAPIClient", { enumerable: true, get: function () { return dashboard_client_1.DashboardAPIClient; } });
@@ -1,4 +1,3 @@
1
- export { DashboardAPIClient } from "./client";
2
- export { sendErrorToolResponse, sendToolResponse } from "./tool-response";
3
- export { HTTPError, NonRetryableHTTPError, RetryableHTTPError } from "./types";
1
+ export type { AuthenticationType, TokenProvider, } from "@empiricalrun/dashboard-client";
2
+ export { DashboardAPIClient, HTTPError, NonRetryableHTTPError, RetryableHTTPError, sendErrorToolResponse, sendErrorToolResponseFromSandbox, sendToolResponse, sendToolResponseFromSandbox, } from "@empiricalrun/dashboard-client";
4
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/dashboard/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/dashboard/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,kBAAkB,EAClB,aAAa,GACd,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,kBAAkB,EAClB,SAAS,EACT,qBAAqB,EACrB,kBAAkB,EAClB,qBAAqB,EACrB,gCAAgC,EAChC,gBAAgB,EAChB,2BAA2B,GAC5B,MAAM,gCAAgC,CAAC"}
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RetryableHTTPError = exports.NonRetryableHTTPError = exports.HTTPError = exports.sendToolResponse = exports.sendErrorToolResponse = exports.DashboardAPIClient = void 0;
4
- var client_1 = require("./client");
5
- Object.defineProperty(exports, "DashboardAPIClient", { enumerable: true, get: function () { return client_1.DashboardAPIClient; } });
6
- var tool_response_1 = require("./tool-response");
7
- Object.defineProperty(exports, "sendErrorToolResponse", { enumerable: true, get: function () { return tool_response_1.sendErrorToolResponse; } });
8
- Object.defineProperty(exports, "sendToolResponse", { enumerable: true, get: function () { return tool_response_1.sendToolResponse; } });
9
- var types_1 = require("./types");
10
- Object.defineProperty(exports, "HTTPError", { enumerable: true, get: function () { return types_1.HTTPError; } });
11
- Object.defineProperty(exports, "NonRetryableHTTPError", { enumerable: true, get: function () { return types_1.NonRetryableHTTPError; } });
12
- Object.defineProperty(exports, "RetryableHTTPError", { enumerable: true, get: function () { return types_1.RetryableHTTPError; } });
3
+ exports.sendToolResponseFromSandbox = exports.sendToolResponse = exports.sendErrorToolResponseFromSandbox = exports.sendErrorToolResponse = exports.RetryableHTTPError = exports.NonRetryableHTTPError = exports.HTTPError = exports.DashboardAPIClient = void 0;
4
+ var dashboard_client_1 = require("@empiricalrun/dashboard-client");
5
+ Object.defineProperty(exports, "DashboardAPIClient", { enumerable: true, get: function () { return dashboard_client_1.DashboardAPIClient; } });
6
+ Object.defineProperty(exports, "HTTPError", { enumerable: true, get: function () { return dashboard_client_1.HTTPError; } });
7
+ Object.defineProperty(exports, "NonRetryableHTTPError", { enumerable: true, get: function () { return dashboard_client_1.NonRetryableHTTPError; } });
8
+ Object.defineProperty(exports, "RetryableHTTPError", { enumerable: true, get: function () { return dashboard_client_1.RetryableHTTPError; } });
9
+ Object.defineProperty(exports, "sendErrorToolResponse", { enumerable: true, get: function () { return dashboard_client_1.sendErrorToolResponse; } });
10
+ Object.defineProperty(exports, "sendErrorToolResponseFromSandbox", { enumerable: true, get: function () { return dashboard_client_1.sendErrorToolResponseFromSandbox; } });
11
+ Object.defineProperty(exports, "sendToolResponse", { enumerable: true, get: function () { return dashboard_client_1.sendToolResponse; } });
12
+ Object.defineProperty(exports, "sendToolResponseFromSandbox", { enumerable: true, get: function () { return dashboard_client_1.sendToolResponseFromSandbox; } });
@@ -0,0 +1,2 @@
1
+ export { sendErrorToolResponseFromSandbox, sendToolResponseFromSandbox, } from "@empiricalrun/dashboard-client";
2
+ //# sourceMappingURL=tool-response-from-sandbox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-response-from-sandbox.d.ts","sourceRoot":"","sources":["../../src/dashboard/tool-response-from-sandbox.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gCAAgC,EAChC,2BAA2B,GAC5B,MAAM,gCAAgC,CAAC"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.sendToolResponseFromSandbox = exports.sendErrorToolResponseFromSandbox = void 0;
4
+ var dashboard_client_1 = require("@empiricalrun/dashboard-client");
5
+ Object.defineProperty(exports, "sendErrorToolResponseFromSandbox", { enumerable: true, get: function () { return dashboard_client_1.sendErrorToolResponseFromSandbox; } });
6
+ Object.defineProperty(exports, "sendToolResponseFromSandbox", { enumerable: true, get: function () { return dashboard_client_1.sendToolResponseFromSandbox; } });
@@ -1,5 +1,2 @@
1
- import type { IDashboardAPIClient } from "@empiricalrun/shared-types/api/base";
2
- import type { Logger, MessageCheckpoint, PendingToolCall, ToolResult } from "@empiricalrun/shared-types/chat-agent";
3
- export declare function sendToolResponse(apiClient: IDashboardAPIClient, chatSessionId: number | undefined, requestId: string, toolCalls: PendingToolCall[], toolResults: ToolResult[], checkpoint: MessageCheckpoint | null, logger: Logger, machineId?: string): Promise<boolean>;
4
- export declare function sendErrorToolResponse(apiClient: IDashboardAPIClient, chatSessionId: number | undefined, requestId: string, toolCalls: PendingToolCall[], errorMessage: string, logger: Logger, machineId?: string): Promise<void>;
1
+ export { getDefaultMachineId, sendErrorToolResponse, sendToolResponse, } from "@empiricalrun/dashboard-client";
5
2
  //# sourceMappingURL=tool-response.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tool-response.d.ts","sourceRoot":"","sources":["../../src/dashboard/tool-response.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC/E,OAAO,KAAK,EACV,MAAM,EACN,iBAAiB,EACjB,eAAe,EACf,UAAU,EACX,MAAM,uCAAuC,CAAC;AAQ/C,wBAAsB,gBAAgB,CACpC,SAAS,EAAE,mBAAmB,EAC9B,aAAa,EAAE,MAAM,GAAG,SAAS,EACjC,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,eAAe,EAAE,EAC5B,WAAW,EAAE,UAAU,EAAE,EACzB,UAAU,EAAE,iBAAiB,GAAG,IAAI,EACpC,MAAM,EAAE,MAAM,EACd,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,OAAO,CAAC,CAoClB;AAED,wBAAsB,qBAAqB,CACzC,SAAS,EAAE,mBAAmB,EAC9B,aAAa,EAAE,MAAM,GAAG,SAAS,EACjC,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,eAAe,EAAE,EAC5B,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,MAAM,EACd,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,IAAI,CAAC,CA2Bf"}
1
+ {"version":3,"file":"tool-response.d.ts","sourceRoot":"","sources":["../../src/dashboard/tool-response.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,gCAAgC,CAAC"}
@@ -1,88 +1,7 @@
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
- exports.sendToolResponse = sendToolResponse;
7
- exports.sendErrorToolResponse = sendErrorToolResponse;
8
- const os_1 = __importDefault(require("os"));
9
- const types_1 = require("./types");
10
- function getDefaultMachineId() {
11
- return os_1.default.hostname();
12
- }
13
- async function sendToolResponse(apiClient, chatSessionId, requestId, toolCalls, toolResults, checkpoint, logger, machineId) {
14
- const resolvedMachineId = machineId ?? getDefaultMachineId();
15
- try {
16
- if (chatSessionId) {
17
- await sendToolResponseForChatSession(apiClient, chatSessionId, toolCalls, toolResults, checkpoint, resolvedMachineId, logger);
18
- }
19
- else {
20
- await sendToolResponseForAdhocToolCall(apiClient, requestId, toolCalls, toolResults, resolvedMachineId, logger);
21
- }
22
- return true;
23
- }
24
- catch (error) {
25
- // Check if it's a 409 Conflict (tool calls were rejected by user)
26
- if (error instanceof types_1.NonRetryableHTTPError && error.status === 409) {
27
- logger.info("Tool calls were rejected by user (409 Conflict), skipping git push");
28
- return false;
29
- }
30
- // For other errors, re-throw
31
- logger.error("Failed to send tool response", error);
32
- throw error;
33
- }
34
- }
35
- async function sendErrorToolResponse(apiClient, chatSessionId, requestId, toolCalls, errorMessage, logger, machineId) {
36
- const resolvedMachineId = machineId ?? getDefaultMachineId();
37
- const toolResults = toolCalls.map(() => ({
38
- isError: true,
39
- result: errorMessage,
40
- }));
41
- if (chatSessionId) {
42
- return sendToolResponseForChatSession(apiClient, chatSessionId, toolCalls, toolResults, null, resolvedMachineId, logger);
43
- }
44
- else {
45
- return sendToolResponseForAdhocToolCall(apiClient, requestId, toolCalls, toolResults, resolvedMachineId, logger);
46
- }
47
- }
48
- async function sendToolResponseForChatSession(apiClient, chatSessionId, toolCalls, toolResults, checkpoint, machineId, logger) {
49
- const url = `/api/chat-sessions/${chatSessionId}/tool-response`;
50
- try {
51
- await apiClient.request(url, {
52
- method: "POST",
53
- body: {
54
- toolResults,
55
- toolCalls,
56
- checkpoint,
57
- machineId,
58
- },
59
- });
60
- }
61
- catch (error) {
62
- logger.error("Failed to send tool response for chat session", {
63
- chatSessionId,
64
- error,
65
- });
66
- throw error;
67
- }
68
- }
69
- async function sendToolResponseForAdhocToolCall(apiClient, requestId, toolCalls, toolResults, machineId, logger) {
70
- const url = `/api/tool-calls/${requestId}/response`;
71
- try {
72
- await apiClient.request(url, {
73
- method: "POST",
74
- body: {
75
- tool_results: toolResults,
76
- tool_calls: toolCalls,
77
- machine_id: machineId,
78
- },
79
- });
80
- }
81
- catch (error) {
82
- logger.error("Failed to send tool response for adhoc tool call", {
83
- requestId,
84
- error,
85
- });
86
- throw error;
87
- }
88
- }
3
+ exports.sendToolResponse = exports.sendErrorToolResponse = exports.getDefaultMachineId = void 0;
4
+ var dashboard_client_1 = require("@empiricalrun/dashboard-client");
5
+ Object.defineProperty(exports, "getDefaultMachineId", { enumerable: true, get: function () { return dashboard_client_1.getDefaultMachineId; } });
6
+ Object.defineProperty(exports, "sendErrorToolResponse", { enumerable: true, get: function () { return dashboard_client_1.sendErrorToolResponse; } });
7
+ Object.defineProperty(exports, "sendToolResponse", { enumerable: true, get: function () { return dashboard_client_1.sendToolResponse; } });
@@ -1,9 +1,2 @@
1
- export declare class HTTPError extends Error {
2
- status: number;
3
- constructor(message: string, status: number);
4
- }
5
- export declare class NonRetryableHTTPError extends HTTPError {
6
- }
7
- export declare class RetryableHTTPError extends HTTPError {
8
- }
1
+ export { HTTPError, NonRetryableHTTPError, RetryableHTTPError, } from "@empiricalrun/dashboard-client";
9
2
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/dashboard/types.ts"],"names":[],"mappings":"AAAA,qBAAa,SAAU,SAAQ,KAAK;IAClC,MAAM,EAAE,MAAM,CAAC;gBACH,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;CAI5C;AAED,qBAAa,qBAAsB,SAAQ,SAAS;CAAG;AAEvD,qBAAa,kBAAmB,SAAQ,SAAS;CAAG"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/dashboard/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,gCAAgC,CAAC"}
@@ -1,17 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RetryableHTTPError = exports.NonRetryableHTTPError = exports.HTTPError = void 0;
4
- class HTTPError extends Error {
5
- status;
6
- constructor(message, status) {
7
- super(message);
8
- this.status = status;
9
- }
10
- }
11
- exports.HTTPError = HTTPError;
12
- class NonRetryableHTTPError extends HTTPError {
13
- }
14
- exports.NonRetryableHTTPError = NonRetryableHTTPError;
15
- class RetryableHTTPError extends HTTPError {
16
- }
17
- exports.RetryableHTTPError = RetryableHTTPError;
4
+ var dashboard_client_1 = require("@empiricalrun/dashboard-client");
5
+ Object.defineProperty(exports, "HTTPError", { enumerable: true, get: function () { return dashboard_client_1.HTTPError; } });
6
+ Object.defineProperty(exports, "NonRetryableHTTPError", { enumerable: true, get: function () { return dashboard_client_1.NonRetryableHTTPError; } });
7
+ Object.defineProperty(exports, "RetryableHTTPError", { enumerable: true, get: function () { return dashboard_client_1.RetryableHTTPError; } });
@@ -1,5 +1,5 @@
1
+ import { BrowserAgentResult } from "@empiricalrun/cua";
1
2
  import { Usage } from "@empiricalrun/shared-types/chat-agent";
2
- import { BrowserAgentResult } from "../agent/cua";
3
3
  export type BrowserAgentIPCPayload = {
4
4
  task: string;
5
5
  result: BrowserAgentResult;
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/file/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,uCAAuC,CAAC;AAK9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AASlD,MAAM,MAAM,sBAAsB,GAAG;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,kBAAkB,CAAC;IAC3B,KAAK,EAAE,KAAK,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AAEF,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,IAAI,CAAa;IACzB,OAAO,CAAC,QAAQ,CAAc;IAC9B,OAAO,CAAC,OAAO,CAAc;IAC7B,OAAO,CAAC,MAAM,CAA4C;IAC1D,OAAO,CAAC,UAAU,CAAkB;IACpC,OAAO,CAAC,UAAU,CAAC,CAAa;IAEhC,OAAO,CAAC,MAAM,CAAiC;IAC/C,OAAO,CAAC,KAAK,CAAoB;IAEjC,OAAO,CAAC,cAAc,CAAqB;gBAE/B,EACV,IAAI,EACJ,OAAO,EACP,UAAU,EACV,UAAU,GACX,EAAE;QACD,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,UAAU,EAAE,OAAO,CAAC;QACpB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;KACzB;IAOD,iBAAiB;;;;IAIjB,iBAAiB;IAIjB,WAAW,CAAC,QAAQ,EAAE,MAAM;IAItB,gBAAgB,IAAI,OAAO,CAAC,MAAM,CAAC;IAsHnC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAgB5B"}
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/file/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEvD,OAAO,EAAE,KAAK,EAAE,MAAM,uCAAuC,CAAC;AAW9D,MAAM,MAAM,sBAAsB,GAAG;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,kBAAkB,CAAC;IAC3B,KAAK,EAAE,KAAK,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AAEF,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,IAAI,CAAa;IACzB,OAAO,CAAC,QAAQ,CAAc;IAC9B,OAAO,CAAC,OAAO,CAAc;IAC7B,OAAO,CAAC,MAAM,CAA4C;IAC1D,OAAO,CAAC,UAAU,CAAkB;IACpC,OAAO,CAAC,UAAU,CAAC,CAAa;IAEhC,OAAO,CAAC,MAAM,CAAiC;IAC/C,OAAO,CAAC,KAAK,CAAoB;IAEjC,OAAO,CAAC,cAAc,CAAqB;gBAE/B,EACV,IAAI,EACJ,OAAO,EACP,UAAU,EACV,UAAU,GACX,EAAE;QACD,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,UAAU,EAAE,OAAO,CAAC;QACpB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;KACzB;IAOD,iBAAiB;;;;IAIjB,iBAAiB;IAIjB,WAAW,CAAC,QAAQ,EAAE,MAAM;IAItB,gBAAgB,IAAI,OAAO,CAAC,MAAM,CAAC;IAsHnC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAgB5B"}
@@ -1 +1 @@
1
- {"version":3,"file":"reader.d.ts","sourceRoot":"","sources":["../../../../src/file-info/adapters/github/reader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAc/E,qBAAa,gBAAgB;IAEzB,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,SAAS;gBADT,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,mBAAmB;IAGlC,iBAAiB,CACrB,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,MAAM,CAAC;IAoBZ,QAAQ,CACZ,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC;YA4CnB,aAAa;CAoD5B;AAyED,wBAAsB,qBAAqB,CACzC,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,mBAAmB,EAC9B,UAAU,EAAE,MAAM,EAClB,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,QAAQ,CAAC,CAwFnB"}
1
+ {"version":3,"file":"reader.d.ts","sourceRoot":"","sources":["../../../../src/file-info/adapters/github/reader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAwB/E,qBAAa,gBAAgB;IAEzB,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,SAAS;gBADT,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,mBAAmB;IAGlC,iBAAiB,CACrB,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,MAAM,CAAC;IAoBZ,QAAQ,CACZ,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC;YAyCnB,aAAa;CAoD5B;AAyED,wBAAsB,qBAAqB,CACzC,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,mBAAmB,EAC9B,UAAU,EAAE,MAAM,EAClB,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,QAAQ,CAAC,CAwFnB"}
@@ -6,6 +6,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.GitHubFileReader = void 0;
7
7
  exports.getFileInfoFromGitHub = getFileInfoFromGitHub;
8
8
  const path_1 = __importDefault(require("path"));
9
+ function isDotfile(filename) {
10
+ const base = path_1.default.basename(filename);
11
+ return base.startsWith(".") && base !== "." && base !== "..";
12
+ }
13
+ function isDirectory(filename) {
14
+ const hasFileExtension = path_1.default.extname(filename) !== "";
15
+ return !isDotfile(filename) && !hasFileExtension;
16
+ }
9
17
  class GitHubFileReader {
10
18
  repoName;
11
19
  apiClient;
@@ -32,9 +40,7 @@ class GitHubFileReader {
32
40
  }
33
41
  async readFile(filePath, branchName, baseBranch) {
34
42
  const resolvedBranch = await this.resolveBranchName(branchName, baseBranch);
35
- // Check if path has file extension - if not, treat as directory
36
- const hasFileExtension = path_1.default.extname(filePath) !== "";
37
- if (!hasFileExtension) {
43
+ if (isDirectory(filePath)) {
38
44
  console.log(`[GitHubFileReader] Reading as directory: ${filePath}`);
39
45
  return this.readDirectory(filePath, resolvedBranch);
40
46
  }