@empiricalrun/test-gen 0.76.0 → 0.77.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +33 -0
- package/dist/agent/base/index.d.ts +25 -21
- package/dist/agent/base/index.d.ts.map +1 -1
- package/dist/agent/base/index.js +48 -37
- package/dist/agent/browsing/run.d.ts +1 -2
- package/dist/agent/browsing/run.d.ts.map +1 -1
- package/dist/agent/browsing/run.js +3 -9
- package/dist/agent/browsing/utils.d.ts +2 -9
- package/dist/agent/browsing/utils.d.ts.map +1 -1
- package/dist/agent/browsing/utils.js +5 -109
- package/dist/agent/chat/agent-loop.d.ts +5 -5
- package/dist/agent/chat/agent-loop.d.ts.map +1 -1
- package/dist/agent/chat/agent-loop.js +3 -8
- package/dist/agent/chat/exports.d.ts +5 -4
- package/dist/agent/chat/exports.d.ts.map +1 -1
- package/dist/agent/chat/exports.js +4 -7
- package/dist/agent/chat/index.d.ts +2 -2
- package/dist/agent/chat/index.d.ts.map +1 -1
- package/dist/agent/chat/index.js +23 -35
- package/dist/agent/chat/models.d.ts +0 -2
- package/dist/agent/chat/models.d.ts.map +1 -1
- package/dist/agent/chat/models.js +12 -26
- package/dist/agent/chat/prompt/pw-utils-docs.d.ts +1 -1
- package/dist/agent/chat/prompt/pw-utils-docs.d.ts.map +1 -1
- package/dist/agent/chat/prompt/pw-utils-docs.js +52 -0
- package/dist/agent/chat/prompt/repo.d.ts.map +1 -1
- package/dist/agent/chat/prompt/repo.js +11 -22
- package/dist/agent/chat/prompt/test-case-def.d.ts +2 -0
- package/dist/agent/chat/prompt/test-case-def.d.ts.map +1 -0
- package/dist/agent/chat/prompt/test-case-def.js +44 -0
- package/dist/agent/chat/state.d.ts +7 -6
- package/dist/agent/chat/state.d.ts.map +1 -1
- package/dist/agent/chat/state.js +15 -45
- package/dist/agent/chat/utils.d.ts +2 -2
- package/dist/agent/chat/utils.d.ts.map +1 -1
- package/dist/agent/chat/utils.js +14 -7
- package/dist/agent/cli.d.ts.map +1 -1
- package/dist/agent/cli.js +62 -58
- package/dist/agent/code-review/executor/index.d.ts +5 -0
- package/dist/agent/code-review/executor/index.d.ts.map +1 -0
- package/dist/agent/code-review/executor/index.js +13 -0
- package/dist/agent/code-review/index.d.ts +8 -3
- package/dist/agent/code-review/index.d.ts.map +1 -1
- package/dist/agent/code-review/index.js +115 -21
- package/dist/agent/code-review/parser.d.ts +5 -0
- package/dist/agent/code-review/parser.d.ts.map +1 -0
- package/dist/agent/code-review/parser.js +70 -0
- package/dist/agent/code-review/types.d.ts +36 -0
- package/dist/agent/code-review/types.d.ts.map +1 -0
- package/dist/agent/code-review/types.js +13 -0
- package/dist/agent/cua/index.d.ts.map +1 -1
- package/dist/agent/cua/index.js +18 -2
- package/dist/agent/cua/model.d.ts.map +1 -1
- package/dist/agent/cua/model.js +4 -1
- package/dist/agent/cua/pw-codegen/pw-pause/index.d.ts.map +1 -1
- package/dist/agent/triage/index.d.ts +2 -2
- package/dist/agent/triage/index.d.ts.map +1 -1
- package/dist/agent/triage/index.js +8 -7
- package/dist/agent/video-analysis/executor/index.d.ts +5 -0
- package/dist/agent/video-analysis/executor/index.d.ts.map +1 -0
- package/dist/agent/video-analysis/executor/index.js +10 -0
- package/dist/agent/video-analysis/index.d.ts +2 -2
- package/dist/agent/video-analysis/index.d.ts.map +1 -1
- package/dist/agent/video-analysis/index.js +38 -13
- package/dist/artifacts/index.d.ts +1 -1
- package/dist/artifacts/index.d.ts.map +1 -1
- package/dist/artifacts/index.js +3 -1
- package/dist/artifacts/utils.d.ts.map +1 -1
- package/dist/bin/index.js +66 -21
- package/dist/constants/index.d.ts +14 -0
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/index.js +33 -1
- package/dist/file/server.d.ts +1 -3
- package/dist/file/server.d.ts.map +1 -1
- package/dist/file/server.js +0 -13
- package/dist/file-info/adapters/file-system/index.d.ts.map +1 -1
- package/dist/file-info/adapters/file-system/reader.d.ts.map +1 -1
- package/dist/file-info/adapters/file-system/reader.js +8 -1
- package/dist/file-info/adapters/github/index.d.ts.map +1 -1
- package/dist/file-info/adapters/github/reader.d.ts +1 -1
- package/dist/file-info/adapters/github/reader.d.ts.map +1 -1
- package/dist/file-info/adapters/github/reader.js +8 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/tools/analyse-video/index.d.ts +5 -0
- package/dist/tools/analyse-video/index.d.ts.map +1 -0
- package/dist/tools/analyse-video/index.js +50 -0
- package/dist/tools/create-pull-request/index.js +4 -6
- package/dist/tools/create-pull-request/utils.d.ts +1 -1
- package/dist/tools/definitions/{fetch-video-analysis.d.ts → analyse-video.d.ts} +13 -8
- package/dist/tools/definitions/analyse-video.d.ts.map +1 -0
- package/dist/tools/definitions/analyse-video.js +60 -0
- package/dist/tools/definitions/review-pull-request.d.ts +3 -0
- package/dist/tools/definitions/review-pull-request.d.ts.map +1 -0
- package/dist/tools/definitions/review-pull-request.js +16 -0
- package/dist/tools/definitions/str_replace_editor.d.ts +1 -0
- package/dist/tools/definitions/str_replace_editor.d.ts.map +1 -1
- package/dist/tools/definitions/str_replace_editor.js +4 -1
- package/dist/tools/definitions/test-gen-browser.d.ts +0 -3
- package/dist/tools/definitions/test-gen-browser.d.ts.map +1 -1
- package/dist/tools/definitions/test-gen-browser.js +33 -8
- package/dist/tools/delete-file/index.d.ts.map +1 -1
- package/dist/tools/delete-file/index.js +1 -19
- package/dist/tools/executor/base.d.ts +32 -0
- package/dist/tools/executor/base.d.ts.map +1 -0
- package/dist/tools/executor/base.js +114 -0
- package/dist/tools/executor/index.d.ts +3 -22
- package/dist/tools/executor/index.d.ts.map +1 -1
- package/dist/tools/executor/index.js +7 -100
- package/dist/tools/executor/utils/checkpoint.d.ts +1 -1
- package/dist/tools/executor/utils/checkpoint.d.ts.map +1 -1
- package/dist/tools/executor/utils/checkpoint.js +6 -2
- package/dist/tools/executor/utils/git.d.ts +2 -2
- package/dist/tools/executor/utils/git.d.ts.map +1 -1
- package/dist/tools/executor/utils/git.js +7 -3
- package/dist/tools/executor/utils/index.d.ts.map +1 -1
- package/dist/tools/executor/utils/index.js +1 -1
- package/dist/tools/fetch-session-diff/index.js +2 -2
- package/dist/tools/file-operations/create.d.ts.map +1 -1
- package/dist/tools/file-operations/create.js +1 -4
- package/dist/tools/file-operations/index.d.ts +2 -1
- package/dist/tools/file-operations/index.d.ts.map +1 -1
- package/dist/tools/file-operations/index.js +4 -1
- package/dist/tools/file-operations/insert.d.ts +1 -2
- package/dist/tools/file-operations/insert.d.ts.map +1 -1
- package/dist/tools/file-operations/insert.js +1 -4
- package/dist/tools/file-operations/replace.d.ts.map +1 -1
- package/dist/tools/file-operations/replace.js +1 -4
- package/dist/tools/grep/index.d.ts.map +1 -1
- package/dist/tools/grep/index.js +18 -11
- package/dist/tools/index.d.ts +5 -5
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +17 -16
- package/dist/tools/merge-conflicts/index.d.ts.map +1 -1
- package/dist/tools/merge-conflicts/index.js +1 -1
- package/dist/tools/rename-file/index.js +1 -1
- package/dist/tools/review-pull-request/index.d.ts.map +1 -1
- package/dist/tools/review-pull-request/index.js +45 -59
- package/dist/tools/run-test.d.ts.map +1 -1
- package/dist/tools/run-test.js +25 -3
- package/dist/tools/test-gen-browser.d.ts.map +1 -1
- package/dist/tools/test-gen-browser.js +51 -47
- package/dist/utils/artifact-paths.d.ts +20 -0
- package/dist/utils/artifact-paths.d.ts.map +1 -0
- package/dist/utils/artifact-paths.js +16 -0
- package/dist/utils/dedup-image-fs.d.ts +2 -16
- package/dist/utils/dedup-image-fs.d.ts.map +1 -1
- package/dist/utils/dedup-image-fs.js +12 -16
- package/dist/utils/dedup-image.d.ts +1 -14
- package/dist/utils/dedup-image.d.ts.map +1 -1
- package/dist/utils/dedup-image.js +7 -62
- package/dist/utils/{local-ffmpeg-client.d.ts → ffmpeg/index.d.ts} +6 -7
- package/dist/utils/ffmpeg/index.d.ts.map +1 -0
- package/dist/utils/{local-ffmpeg-client.js → ffmpeg/index.js} +169 -53
- package/dist/utils/find-threshold.d.ts +8 -0
- package/dist/utils/find-threshold.d.ts.map +1 -0
- package/dist/utils/find-threshold.js +55 -0
- package/dist/utils/hash.d.ts +2 -0
- package/dist/utils/hash.d.ts.map +1 -0
- package/dist/utils/hash.js +24 -0
- package/dist/utils/model.d.ts +1 -1
- package/dist/utils/model.d.ts.map +1 -1
- package/dist/utils/model.js +7 -5
- package/dist/utils/repo-tree.d.ts +0 -1
- package/dist/utils/repo-tree.d.ts.map +1 -1
- package/dist/utils/repo-tree.js +2 -14
- package/dist/utils/slug.js +1 -1
- package/dist/video-core/agent-orchestrator.d.ts +14 -0
- package/dist/video-core/agent-orchestrator.d.ts.map +1 -0
- package/dist/video-core/agent-orchestrator.js +78 -0
- package/dist/video-core/analysis-server.d.ts +24 -0
- package/dist/video-core/analysis-server.d.ts.map +1 -0
- package/dist/video-core/analysis-server.js +398 -0
- package/dist/video-core/analysis-viewer.html +1374 -0
- package/dist/video-core/index.d.ts +44 -0
- package/dist/video-core/index.d.ts.map +1 -0
- package/dist/video-core/index.js +204 -0
- package/dist/video-core/model-limits.d.ts +4 -0
- package/dist/video-core/model-limits.d.ts.map +1 -0
- package/dist/video-core/model-limits.js +67 -0
- package/dist/video-core/storage-manager.d.ts +5 -0
- package/dist/video-core/storage-manager.d.ts.map +1 -0
- package/dist/video-core/storage-manager.js +55 -0
- package/dist/video-core/types.d.ts +13 -0
- package/dist/video-core/types.d.ts.map +1 -0
- package/dist/video-core/types.js +2 -0
- package/dist/video-core/utils.d.ts +25 -0
- package/dist/video-core/utils.d.ts.map +1 -0
- package/dist/video-core/utils.js +211 -0
- package/dist/video-core/xml-parser.d.ts +3 -0
- package/dist/video-core/xml-parser.d.ts.map +1 -0
- package/dist/video-core/xml-parser.js +27 -0
- package/package.json +5 -6
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/agent/chat/prompt/index.d.ts +0 -6
- package/dist/agent/chat/prompt/index.d.ts.map +0 -1
- package/dist/agent/chat/prompt/index.js +0 -200
- package/dist/agent/code-review/prompt.d.ts +0 -2
- package/dist/agent/code-review/prompt.d.ts.map +0 -1
- package/dist/agent/code-review/prompt.js +0 -55
- package/dist/agent/diagnosis-agent/index.d.ts +0 -11
- package/dist/agent/diagnosis-agent/index.d.ts.map +0 -1
- package/dist/agent/diagnosis-agent/index.js +0 -88
- package/dist/agent/diagnosis-agent/strict-mode-violation.d.ts +0 -10
- package/dist/agent/diagnosis-agent/strict-mode-violation.d.ts.map +0 -1
- package/dist/agent/diagnosis-agent/strict-mode-violation.js +0 -30
- package/dist/tools/definitions/extract-frames-from-video.d.ts +0 -39
- package/dist/tools/definitions/extract-frames-from-video.d.ts.map +0 -1
- package/dist/tools/definitions/extract-frames-from-video.js +0 -60
- package/dist/tools/definitions/fetch-video-analysis.d.ts.map +0 -1
- package/dist/tools/definitions/fetch-video-analysis.js +0 -61
- package/dist/tools/extract-frames-from-video/index.d.ts +0 -7
- package/dist/tools/extract-frames-from-video/index.d.ts.map +0 -1
- package/dist/tools/extract-frames-from-video/index.js +0 -145
- package/dist/tools/fetch-video-analysis/index.d.ts +0 -5
- package/dist/tools/fetch-video-analysis/index.d.ts.map +0 -1
- package/dist/tools/fetch-video-analysis/index.js +0 -149
- package/dist/tools/fetch-video-analysis/open-ai.d.ts +0 -6
- package/dist/tools/fetch-video-analysis/open-ai.d.ts.map +0 -1
- package/dist/tools/fetch-video-analysis/open-ai.js +0 -37
- package/dist/tools/fetch-video-analysis/utils.d.ts +0 -16
- package/dist/tools/fetch-video-analysis/utils.d.ts.map +0 -1
- package/dist/tools/fetch-video-analysis/utils.js +0 -121
- package/dist/tools/fetch-video-analysis/video-analysis.d.ts +0 -7
- package/dist/tools/fetch-video-analysis/video-analysis.d.ts.map +0 -1
- package/dist/tools/fetch-video-analysis/video-analysis.js +0 -70
- package/dist/tools/file-operations/shared/git-helper.d.ts +0 -4
- package/dist/tools/file-operations/shared/git-helper.d.ts.map +0 -1
- package/dist/tools/file-operations/shared/git-helper.js +0 -29
- package/dist/utils/local-ffmpeg-client.d.ts.map +0 -1
- package/eslint.config.mjs +0 -43
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/agent/cua/pw-codegen/pw-pause/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAGvC,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/agent/cua/pw-codegen/pw-pause/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAGvC,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAMjD,OAAO,EAAE,2BAA2B,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAE9E,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,MAAM,oBAwCvD;AAED,qBAAa,sBAAuB,YAAW,qBAAqB;IAClE,OAAO,CAAC,IAAI,CAAa;IACzB,OAAO,CAAC,IAAI,CAAmB;IAC/B,OAAO,CAAC,MAAM,CAA4C;IAC1D,OAAO,CAAC,iBAAiB,CAAqB;;YAMhC,QAAQ;IAUhB,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAkBrC,sBAAsB,CAAC,IAAI,EAAE,IAAI;IAqBjC,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAI7B,oBAAoB,IAAI,OAAO,CAAC,MAAM,CAAC;CAU9C"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ToolsForLLM } from "@empiricalrun/shared-types";
|
|
2
2
|
import { BaseAgent } from "../base";
|
|
3
3
|
export declare class TriageAgent extends BaseAgent {
|
|
4
|
-
protected getTools():
|
|
4
|
+
protected getTools(): ToolsForLLM;
|
|
5
5
|
protected buildSystemPrompt(repoContext?: string): Promise<string>;
|
|
6
6
|
}
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/agent/triage/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/agent/triage/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAoB9D,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAGpC,qBAAa,WAAY,SAAQ,SAAS;IACxC,SAAS,CAAC,QAAQ,IAAI,WAAW;cA2BjB,iBAAiB,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAoEzE"}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.TriageAgent = void 0;
|
|
4
4
|
const tools_1 = require("../../tools");
|
|
5
5
|
const base_1 = require("../base");
|
|
6
|
+
const test_case_def_1 = require("../chat/prompt/test-case-def");
|
|
6
7
|
class TriageAgent extends base_1.BaseAgent {
|
|
7
8
|
getTools() {
|
|
8
9
|
const tools = [
|
|
@@ -19,18 +20,16 @@ class TriageAgent extends base_1.BaseAgent {
|
|
|
19
20
|
tools_1.createIssueTool,
|
|
20
21
|
tools_1.updateIssueTool,
|
|
21
22
|
tools_1.viewFailedTestRunReportTool,
|
|
22
|
-
tools_1.
|
|
23
|
+
tools_1.analyseVideo,
|
|
23
24
|
tools_1.fetchLastSuccessfulTestRunTool,
|
|
24
25
|
tools_1.sendTriageSummaryTool,
|
|
25
26
|
// Model-specific tools
|
|
26
27
|
...(0, tools_1.textEditorToolsForModel)(this.selectedModel),
|
|
27
28
|
];
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
return tools;
|
|
29
|
+
return {
|
|
30
|
+
custom: tools,
|
|
31
|
+
builtInTextEditor: (0, tools_1.hasBuiltInTextEditor)(this.selectedModel),
|
|
32
|
+
};
|
|
34
33
|
}
|
|
35
34
|
async buildSystemPrompt(repoContext) {
|
|
36
35
|
if (!repoContext) {
|
|
@@ -91,6 +90,8 @@ You are provided with multiple tools to help you understand each failing test ca
|
|
|
91
90
|
- After you are done with triaging and creating issues, summarize the work done with a list of created issues for the user to review. Don't be too verbose - a bullet list of issues created or updated, with a small description is enough.
|
|
92
91
|
- It is important to show proof that you have gone through all of the failures in the test run report, so use numbers to call out 1. total failures, and 2. failures associated with each issue.
|
|
93
92
|
|
|
93
|
+
${test_case_def_1.testCasesDefinitionPrompt}
|
|
94
|
+
|
|
94
95
|
# Repo context
|
|
95
96
|
${repoContext}
|
|
96
97
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/agent/video-analysis/executor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACtB,MAAM,8BAA8B,CAAC;AAEtC,qBAAa,yBAA0B,SAAQ,gBAAgB;gBACjD,MAAM,EAAE,IAAI,CAAC,qBAAqB,EAAE,OAAO,CAAC;CAGzD"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VideoAnalysisToolExecutor = void 0;
|
|
4
|
+
const base_1 = require("../../../tools/executor/base");
|
|
5
|
+
class VideoAnalysisToolExecutor extends base_1.BaseToolExecutor {
|
|
6
|
+
constructor(params) {
|
|
7
|
+
super({ ...params, tools: [] });
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.VideoAnalysisToolExecutor = VideoAnalysisToolExecutor;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ToolsForLLM } from "@empiricalrun/shared-types";
|
|
2
2
|
import { BaseAgent } from "../base";
|
|
3
3
|
export declare class VideoAnalysisAgent extends BaseAgent {
|
|
4
|
-
protected getTools():
|
|
4
|
+
protected getTools(): ToolsForLLM;
|
|
5
5
|
protected buildSystemPrompt(): Promise<string>;
|
|
6
6
|
}
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/agent/video-analysis/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/agent/video-analysis/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,qBAAa,kBAAmB,SAAQ,SAAS;IAC/C,SAAS,CAAC,QAAQ,IAAI,WAAW;cAOjB,iBAAiB,IAAI,OAAO,CAAC,MAAM,CAAC;CA+CrD"}
|
|
@@ -1,34 +1,59 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.VideoAnalysisAgent = void 0;
|
|
4
|
-
const tools_1 = require("../../tools");
|
|
5
4
|
const base_1 = require("../base");
|
|
6
5
|
class VideoAnalysisAgent extends base_1.BaseAgent {
|
|
7
6
|
getTools() {
|
|
8
|
-
return
|
|
7
|
+
return {
|
|
8
|
+
custom: [],
|
|
9
|
+
builtInTextEditor: false,
|
|
10
|
+
};
|
|
9
11
|
}
|
|
10
12
|
async buildSystemPrompt() {
|
|
11
13
|
return `
|
|
12
14
|
You are a video analysis agent specialized in analyzing screen recordings and user interface interactions.
|
|
13
15
|
|
|
14
|
-
|
|
15
|
-
- extract_frames: Extract frames from videos for detailed visual analysis
|
|
16
|
-
- fetch_video_analysis: Get comprehensive video analysis summary (legacy)
|
|
16
|
+
You will receive individual video frames with their Frame IDs as user input for detailed visual analysis.
|
|
17
17
|
|
|
18
|
-
When analyzing
|
|
19
|
-
1.
|
|
20
|
-
2.
|
|
21
|
-
3.
|
|
22
|
-
4. The Summary should be in a bullet point format
|
|
23
|
-
5. Reference frame IDs when discussing specific moments: "In frame_abc123_001, I can see..."
|
|
18
|
+
When analyzing the provided frames:
|
|
19
|
+
1. Analyze each frame for UI elements, user actions, and state changes
|
|
20
|
+
2. Provide specific observations about what's happening in each frame
|
|
21
|
+
3. The Summary should be in the given XML format
|
|
24
22
|
|
|
25
23
|
Your analysis should be:
|
|
26
24
|
- Detailed and specific about UI elements and interactions
|
|
27
25
|
- Sequential, following the flow of actions in the video
|
|
28
26
|
|
|
29
|
-
|
|
27
|
+
CRITICAL: You MUST use the EXACT frame IDs that are provided with each frame. Each frame will be labeled with text like "Frame ID: frame_000000" - use this exact ID in your <key_frame> tags.
|
|
30
28
|
|
|
31
|
-
|
|
29
|
+
Note: The Last frame from the attachments should always be included in the <key_frame> tag
|
|
30
|
+
|
|
31
|
+
# Output format
|
|
32
|
+
<summary>
|
|
33
|
+
<section>
|
|
34
|
+
<key_frame>frame_id</key_frame>
|
|
35
|
+
<description>text description of the frame</description>
|
|
36
|
+
</section>
|
|
37
|
+
<section>
|
|
38
|
+
<key_frame>frame_id</key_frame>
|
|
39
|
+
<description>text description of the frame</description>
|
|
40
|
+
</section>
|
|
41
|
+
.
|
|
42
|
+
.
|
|
43
|
+
.
|
|
44
|
+
<section>
|
|
45
|
+
<key_frame>frame_id</key_frame>
|
|
46
|
+
<description>text description of the frame</description>
|
|
47
|
+
</section>
|
|
48
|
+
</summary>
|
|
49
|
+
|
|
50
|
+
## Example
|
|
51
|
+
If the attachments include "frame_000000.png", "frame_000078.png", and "frame_000156.png", then:
|
|
52
|
+
- To reference the first frame, use: <key_frame>frame_000000</key_frame>
|
|
53
|
+
- To reference the second frame, use: <key_frame>frame_000078</key_frame>
|
|
54
|
+
- To reference the third frame, use: <key_frame>frame_000156</key_frame>
|
|
55
|
+
|
|
56
|
+
WRONG: <key_frame>frame_000001</key_frame> (unless there's actually a file named frame_000001.png in the attachments)
|
|
32
57
|
`;
|
|
33
58
|
}
|
|
34
59
|
}
|
|
@@ -46,7 +46,7 @@ export declare class UploadArtifactsQueue {
|
|
|
46
46
|
private artifactResults;
|
|
47
47
|
private uploadPromise;
|
|
48
48
|
constructor(baseRepoPath: string, toolCallId: string);
|
|
49
|
-
addTask(artifacts: ArtifactInput[]): Promise<
|
|
49
|
+
addTask(artifacts: ArtifactInput[]): Promise<Artifact[]>;
|
|
50
50
|
waitForCompletion(): Promise<Artifact[]>;
|
|
51
51
|
}
|
|
52
52
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/artifacts/index.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,QAAQ,EACR,aAAa,EAId,MAAM,4BAA4B,CAAC;AAwBpC,wBAAgB,2BAA2B,uBAM1C;AA6HD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,aAAa,EAAE,EACvB,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,QAAQ,EAAE,CAAC,CAsErB;AAED,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,eAAe,CAAkB;IACzC,OAAO,CAAC,aAAa,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/artifacts/index.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,QAAQ,EACR,aAAa,EAId,MAAM,4BAA4B,CAAC;AAwBpC,wBAAgB,2BAA2B,uBAM1C;AA6HD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,aAAa,EAAE,EACvB,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,QAAQ,EAAE,CAAC,CAsErB;AAED,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,eAAe,CAAkB;IACzC,OAAO,CAAC,aAAa,CAAoC;gBAE7C,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM;IAK7C,OAAO,CAAC,SAAS,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IAiBlD,iBAAiB,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;CAMtD"}
|
package/dist/artifacts/index.js
CHANGED
|
@@ -230,15 +230,17 @@ class UploadArtifactsQueue {
|
|
|
230
230
|
this.baseRepoPath = baseRepoPath;
|
|
231
231
|
this.toolCallId = toolCallId;
|
|
232
232
|
}
|
|
233
|
-
|
|
233
|
+
addTask(artifacts) {
|
|
234
234
|
this.uploadPromise = collectArtifacts(artifacts, this.baseRepoPath, this.toolCallId)
|
|
235
235
|
.then((results) => {
|
|
236
236
|
this.artifactResults.push(...results);
|
|
237
|
+
return results;
|
|
237
238
|
})
|
|
238
239
|
.catch((error) => {
|
|
239
240
|
console.error("Error processing artifact upload task:", error);
|
|
240
241
|
throw error;
|
|
241
242
|
});
|
|
243
|
+
return this.uploadPromise;
|
|
242
244
|
}
|
|
243
245
|
async waitForCompletion() {
|
|
244
246
|
if (this.uploadPromise) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/artifacts/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,4BAA4B,CAAC;AACpC,OAAO,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/artifacts/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAGL,UAAU,IAAI,oBAAoB,EACnC,MAAM,2BAA2B,CAAC;AAInC;;;;GAIG;AACH,wBAAgB,0CAA0C,CACxD,MAAM,EAAE,oBAAoB,EAC5B,cAAc,CAAC,EAAE,MAAM,GACtB,KAAK,CAAC,gBAAgB,GAAG,iBAAiB,CAAC,CAsE7C;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,aAAa,EAAE,CAmCxE"}
|
package/dist/bin/index.js
CHANGED
|
@@ -14,23 +14,14 @@ 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 video_core_1 = require("../video-core");
|
|
18
|
+
const analysis_server_1 = require("../video-core/analysis-server");
|
|
17
19
|
const environments_1 = require("./environments");
|
|
18
20
|
const setup_1 = require("./setup");
|
|
19
21
|
const utils_1 = require("./utils");
|
|
20
22
|
dotenv_1.default.config({
|
|
21
23
|
path: [".env.local", ".env"],
|
|
22
24
|
});
|
|
23
|
-
async function runChatAgent({ modelInput, useDiskForChatState, prompt: initialPromptContent, agentMode = "chat", resetChat, useFSCache, }) {
|
|
24
|
-
const resolvedModel = (0, models_1.resolveChatModelBasedOnInput)(modelInput);
|
|
25
|
-
return await (0, cli_1.runChatAgentForCLI)({
|
|
26
|
-
selectedModel: resolvedModel,
|
|
27
|
-
useDiskForChatState: useDiskForChatState || false,
|
|
28
|
-
initialPromptContent,
|
|
29
|
-
agentMode,
|
|
30
|
-
resetChat: resetChat || false,
|
|
31
|
-
useFSCache: useFSCache || false,
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
25
|
async function main() {
|
|
35
26
|
const rawMode = process.argv.includes("--raw");
|
|
36
27
|
if (!rawMode) {
|
|
@@ -180,15 +171,16 @@ async function main() {
|
|
|
180
171
|
.option("--prompt <string>", "String to pass as user prompt")
|
|
181
172
|
.option("--agent-mode <mode>", "Mode of the agent: 'chat' or 'triage' or 'video' or 'code-review' (Defaults to 'chat')")
|
|
182
173
|
.option("--use-cache", "Use filesystem cache for LLM responses (Claude-only, and will disable streaming)")
|
|
183
|
-
.option("--reset-
|
|
174
|
+
.option("--reset-state", "Clear any saved chat state (last-chat.json) before starting")
|
|
184
175
|
.action(async (options) => {
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
176
|
+
const resolvedModel = (0, models_1.resolveChatModelBasedOnInput)(options.model);
|
|
177
|
+
await (0, cli_1.runChatAgentForCLI)({
|
|
178
|
+
selectedModel: resolvedModel,
|
|
179
|
+
useDiskForChatState: options.useDisk || false,
|
|
180
|
+
initialPromptContent: options.prompt,
|
|
181
|
+
agentMode: options.agentMode || "chat",
|
|
182
|
+
resetChat: options.resetState || false,
|
|
183
|
+
useFSCache: options.useCache || false,
|
|
192
184
|
});
|
|
193
185
|
process.exit(0);
|
|
194
186
|
});
|
|
@@ -198,8 +190,8 @@ async function main() {
|
|
|
198
190
|
.requiredOption("--id <id>", "Chat session ID")
|
|
199
191
|
.action(async (opts) => {
|
|
200
192
|
try {
|
|
201
|
-
const data = await client_1.apiClient.request(`/api/chat-sessions/${opts.id}`, { method: "GET" });
|
|
202
|
-
const chatState = data.data.
|
|
193
|
+
const data = await client_1.apiClient.request(`/api/chat-sessions/${opts.id}/state`, { method: "GET" });
|
|
194
|
+
const chatState = data.data.chat_state;
|
|
203
195
|
const filename = `chat-session-${opts.id}.json`;
|
|
204
196
|
fs_1.default.writeFileSync(filename, JSON.stringify(chatState, null, 2));
|
|
205
197
|
console.log(`✅ Chat state saved to ${filename}`);
|
|
@@ -235,6 +227,59 @@ async function main() {
|
|
|
235
227
|
}
|
|
236
228
|
process.exit(0);
|
|
237
229
|
});
|
|
230
|
+
program
|
|
231
|
+
.command("analyze-video")
|
|
232
|
+
.description("Analyze video and start viewer server with results")
|
|
233
|
+
.requiredOption("--url <url>", "Video URL")
|
|
234
|
+
.option("--params <params>", "Video analysis parameters. Format: key=value pairs separated by comma ','. Supported keys: model, fps, threshold, startTime, duration. Example: --params 'fps=30,threshold=0.01,startTime=00:00:10,duration=00:01:00'")
|
|
235
|
+
.option("--no-server", "Skip starting the analysis viewer server")
|
|
236
|
+
.action(async (opts) => {
|
|
237
|
+
const { url, params, server } = opts;
|
|
238
|
+
if (!url) {
|
|
239
|
+
console.error("❌ Video URL is required");
|
|
240
|
+
process.exit(1);
|
|
241
|
+
}
|
|
242
|
+
await (0, video_core_1.runVideoAnalysisForCli)({
|
|
243
|
+
url,
|
|
244
|
+
params: params || "",
|
|
245
|
+
startServer: server,
|
|
246
|
+
});
|
|
247
|
+
});
|
|
248
|
+
program
|
|
249
|
+
.command("serve-analysis")
|
|
250
|
+
.option("--root-path <path>", "Root path to discover analysis directories", "video-analysis")
|
|
251
|
+
.description("Start viewer server to browse analysis results from multiple directories")
|
|
252
|
+
.action(async (opts) => {
|
|
253
|
+
try {
|
|
254
|
+
let handle;
|
|
255
|
+
handle = await (0, analysis_server_1.startAnalysisServer)(opts.rootPath);
|
|
256
|
+
console.log(`🌐 Analysis viewer available at: ${handle.url}`);
|
|
257
|
+
console.log(`📁 Serving analysis results from: ${opts.rootPath}`);
|
|
258
|
+
console.log("📋 Press Ctrl+C to stop the server");
|
|
259
|
+
let isShuttingDown = false;
|
|
260
|
+
const gracefulShutdown = async (signal) => {
|
|
261
|
+
if (isShuttingDown)
|
|
262
|
+
return;
|
|
263
|
+
isShuttingDown = true;
|
|
264
|
+
console.log(`\n🛑 Received ${signal}, shutting down server...`);
|
|
265
|
+
try {
|
|
266
|
+
await handle.close();
|
|
267
|
+
console.log("✅ Server closed successfully");
|
|
268
|
+
process.exit(0);
|
|
269
|
+
}
|
|
270
|
+
catch (error) {
|
|
271
|
+
console.error("❌ Error closing server:", error);
|
|
272
|
+
process.exit(1);
|
|
273
|
+
}
|
|
274
|
+
};
|
|
275
|
+
process.once("SIGINT", () => gracefulShutdown("SIGINT"));
|
|
276
|
+
process.once("SIGTERM", () => gracefulShutdown("SIGTERM"));
|
|
277
|
+
}
|
|
278
|
+
catch (error) {
|
|
279
|
+
console.error("❌ Error loading or serving data:", error instanceof Error ? error.message : error);
|
|
280
|
+
process.exit(1);
|
|
281
|
+
}
|
|
282
|
+
});
|
|
238
283
|
program.parse(process.argv);
|
|
239
284
|
}
|
|
240
285
|
main().catch((error) => {
|
|
@@ -4,4 +4,18 @@ export declare const DEFAULT_MODEL_PROVIDER: LLMProvider;
|
|
|
4
4
|
export declare const DEFAULT_MODEL: LLMModel;
|
|
5
5
|
export declare const DEFAULT_MODEL_PARAMETERS: ModelParameters;
|
|
6
6
|
export declare const DEFAULT_O1_MODEL_PARAMETERS: ModelParameters;
|
|
7
|
+
export declare const VIDEO_ANALYSIS: {
|
|
8
|
+
readonly FRAME_INDEX_PADDING: 6;
|
|
9
|
+
readonly DEFAULT_MODEL: "claude-sonnet-4-20250514";
|
|
10
|
+
readonly DEFAULT_FPS: 25;
|
|
11
|
+
readonly DEFAULT_THRESHOLD: 0.01;
|
|
12
|
+
readonly DEFAULT_FALLBACK_FPS: 30;
|
|
13
|
+
readonly CLAUDE_MAX_IMAGES_PER_BATCH: 100;
|
|
14
|
+
readonly CLAUDE_MAX_REQUEST_SIZE_MB: 32;
|
|
15
|
+
readonly OPENAI_MAX_IMAGES_PER_BATCH: 500;
|
|
16
|
+
readonly OPENAI_MAX_REQUEST_SIZE_MB: 50;
|
|
17
|
+
readonly DEFAULT_FRAME_SIZE_MB: 0.2;
|
|
18
|
+
readonly BATCH_SIZE_REDUCTION_FACTOR: 0.8;
|
|
19
|
+
};
|
|
20
|
+
export declare const DEFAULT_EXCLUDE: (string | RegExp)[];
|
|
7
21
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAE3E,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAItD,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,WAAsB,CAAC;AAE5D,eAAO,MAAM,aAAa,EAAE,QAAmB,CAAC;AAEhD,eAAO,MAAM,wBAAwB,EAAE,eAGtC,CAAC;AAEF,eAAO,MAAM,2BAA2B,EAAE,eAGzC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAE3E,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAItD,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,WAAsB,CAAC;AAE5D,eAAO,MAAM,aAAa,EAAE,QAAmB,CAAC;AAEhD,eAAO,MAAM,wBAAwB,EAAE,eAGtC,CAAC;AAEF,eAAO,MAAM,2BAA2B,EAAE,eAGzC,CAAC;AAGF,eAAO,MAAM,cAAc;;;;;;;;;;;;CAqBjB,CAAC;AAEX,eAAO,MAAM,eAAe,qBAY3B,CAAC"}
|
package/dist/constants/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DEFAULT_O1_MODEL_PARAMETERS = exports.DEFAULT_MODEL_PARAMETERS = exports.DEFAULT_MODEL = exports.DEFAULT_MODEL_PROVIDER = exports.MODEL_API_KEYS = void 0;
|
|
3
|
+
exports.DEFAULT_EXCLUDE = exports.VIDEO_ANALYSIS = exports.DEFAULT_O1_MODEL_PARAMETERS = exports.DEFAULT_MODEL_PARAMETERS = exports.DEFAULT_MODEL = exports.DEFAULT_MODEL_PROVIDER = exports.MODEL_API_KEYS = void 0;
|
|
4
4
|
exports.MODEL_API_KEYS = {
|
|
5
5
|
google: process.env.GOOGLE_API_KEY || "",
|
|
6
6
|
anthropic: process.env.ANTHROPIC_API_KEY || "",
|
|
@@ -16,3 +16,35 @@ exports.DEFAULT_O1_MODEL_PARAMETERS = {
|
|
|
16
16
|
temperature: 1,
|
|
17
17
|
max_completion_tokens: 35_000,
|
|
18
18
|
};
|
|
19
|
+
// Video Analysis Constants
|
|
20
|
+
exports.VIDEO_ANALYSIS = {
|
|
21
|
+
// Frame processing
|
|
22
|
+
FRAME_INDEX_PADDING: 6,
|
|
23
|
+
// Default analysis parameters
|
|
24
|
+
DEFAULT_MODEL: "claude-sonnet-4-20250514",
|
|
25
|
+
DEFAULT_FPS: 25,
|
|
26
|
+
DEFAULT_THRESHOLD: 0.01,
|
|
27
|
+
DEFAULT_FALLBACK_FPS: 30,
|
|
28
|
+
// Model limits - Claude
|
|
29
|
+
CLAUDE_MAX_IMAGES_PER_BATCH: 100,
|
|
30
|
+
CLAUDE_MAX_REQUEST_SIZE_MB: 32,
|
|
31
|
+
// Model limits - OpenAI
|
|
32
|
+
OPENAI_MAX_IMAGES_PER_BATCH: 500,
|
|
33
|
+
OPENAI_MAX_REQUEST_SIZE_MB: 50,
|
|
34
|
+
// Processing defaults
|
|
35
|
+
DEFAULT_FRAME_SIZE_MB: 0.2,
|
|
36
|
+
BATCH_SIZE_REDUCTION_FACTOR: 0.8,
|
|
37
|
+
};
|
|
38
|
+
exports.DEFAULT_EXCLUDE = [
|
|
39
|
+
"node_modules",
|
|
40
|
+
"dist",
|
|
41
|
+
"build",
|
|
42
|
+
/\.git/,
|
|
43
|
+
".DS_Store",
|
|
44
|
+
"playwright-report",
|
|
45
|
+
"test-results",
|
|
46
|
+
".empiricalrun",
|
|
47
|
+
"auth",
|
|
48
|
+
"package-lock.json",
|
|
49
|
+
/^ffmpeg-test/,
|
|
50
|
+
];
|
package/dist/file/server.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Usage } from "@empiricalrun/shared-types";
|
|
2
2
|
import { BrowserAgentResult } from "../agent/cua";
|
|
3
3
|
export type BrowserAgentIPCPayload = {
|
|
4
4
|
task: string;
|
|
@@ -14,7 +14,6 @@ export declare class FileServiceServer {
|
|
|
14
14
|
private server;
|
|
15
15
|
private updateFile;
|
|
16
16
|
private onComplete?;
|
|
17
|
-
private artifactsInputs;
|
|
18
17
|
private result;
|
|
19
18
|
private usage;
|
|
20
19
|
private codegenSources;
|
|
@@ -28,7 +27,6 @@ export declare class FileServiceServer {
|
|
|
28
27
|
result: BrowserAgentResult | undefined;
|
|
29
28
|
usage: Usage | undefined;
|
|
30
29
|
};
|
|
31
|
-
getArtifactInputsFromServer(): ArtifactInput[];
|
|
32
30
|
getCodegenSources(): string | undefined;
|
|
33
31
|
setFilePath(filePath: string): void;
|
|
34
32
|
startFileService(): Promise<number>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/file/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/file/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAKnD,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;IAqHnC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAgB5B"}
|
package/dist/file/server.js
CHANGED
|
@@ -16,7 +16,6 @@ class FileServiceServer {
|
|
|
16
16
|
server;
|
|
17
17
|
updateFile = false;
|
|
18
18
|
onComplete;
|
|
19
|
-
artifactsInputs = [];
|
|
20
19
|
result;
|
|
21
20
|
usage;
|
|
22
21
|
codegenSources;
|
|
@@ -29,9 +28,6 @@ class FileServiceServer {
|
|
|
29
28
|
getResultAndUsage() {
|
|
30
29
|
return { result: this.result, usage: this.usage };
|
|
31
30
|
}
|
|
32
|
-
getArtifactInputsFromServer() {
|
|
33
|
-
return this.artifactsInputs;
|
|
34
|
-
}
|
|
35
31
|
getCodegenSources() {
|
|
36
32
|
return this.codegenSources;
|
|
37
33
|
}
|
|
@@ -110,15 +106,6 @@ class FileServiceServer {
|
|
|
110
106
|
const { generatedCode, importPaths, result, usage } = req.body;
|
|
111
107
|
this.result = result;
|
|
112
108
|
this.usage = usage;
|
|
113
|
-
this.artifactsInputs = this.result
|
|
114
|
-
.filter((item) => item.type === "screenshot")
|
|
115
|
-
.map((item) => item.screenshot)
|
|
116
|
-
.map((artifact) => ({
|
|
117
|
-
...artifact,
|
|
118
|
-
data: Buffer.isBuffer(artifact.data)
|
|
119
|
-
? artifact.data
|
|
120
|
-
: Buffer.from(artifact.data),
|
|
121
|
-
}));
|
|
122
109
|
if (!this.updateFile) {
|
|
123
110
|
// Not updating the file in this scenario
|
|
124
111
|
if (this.onComplete)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/file-info/adapters/file-system/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAExD,OAAO,EAEL,KAAK,qBAAqB,EAC3B,MAAM,+CAA+C,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/file-info/adapters/file-system/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAExD,OAAO,EAEL,KAAK,qBAAqB,EAC3B,MAAM,+CAA+C,CAAC;AAGvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C,wBAAsB,uBAAuB,CAAC,EAC5C,KAAK,EACL,QAAQ,EACR,gBAAgB,GACjB,EAAE;IACD,KAAK,EAAE,qBAAqB,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,MAAM,CAAC;CAC1B,GAAG,OAAO,CAAC,UAAU,CAAC,CAmBtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reader.d.ts","sourceRoot":"","sources":["../../../../src/file-info/adapters/file-system/reader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"reader.d.ts","sourceRoot":"","sources":["../../../../src/file-info/adapters/file-system/reader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAMtE,qBAAa,oBAAoB;IACzB,QAAQ,CACZ,QAAQ,EAAE,MAAM,EAChB,gBAAgB,EAAE,MAAM,GACvB,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC;CAalC;AAED,wBAAsB,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAwC5E"}
|
|
@@ -8,6 +8,7 @@ exports.getFileInfoFromFS = getFileInfoFromFS;
|
|
|
8
8
|
const fs_1 = __importDefault(require("fs"));
|
|
9
9
|
const promises_1 = __importDefault(require("fs/promises"));
|
|
10
10
|
const path_1 = __importDefault(require("path"));
|
|
11
|
+
const constants_1 = require("../../../constants");
|
|
11
12
|
class FilesystemFileReader {
|
|
12
13
|
async readFile(filePath, absoluteFilePath) {
|
|
13
14
|
if (!fs_1.default.existsSync(absoluteFilePath)) {
|
|
@@ -23,7 +24,6 @@ class FilesystemFileReader {
|
|
|
23
24
|
}
|
|
24
25
|
exports.FilesystemFileReader = FilesystemFileReader;
|
|
25
26
|
async function getFileInfoFromFS(directory) {
|
|
26
|
-
// TODO: This traverses all node_modules - can be excluded with DEFAULT_EXCLUDE
|
|
27
27
|
let currentDirName = path_1.default.basename(directory);
|
|
28
28
|
let currentDir = {
|
|
29
29
|
type: "directory",
|
|
@@ -33,6 +33,13 @@ async function getFileInfoFromFS(directory) {
|
|
|
33
33
|
};
|
|
34
34
|
const files = await promises_1.default.readdir(directory);
|
|
35
35
|
for (const file of files) {
|
|
36
|
+
const shouldExclude = constants_1.DEFAULT_EXCLUDE.some((pattern) => typeof pattern === "string"
|
|
37
|
+
? file === pattern
|
|
38
|
+
: pattern instanceof RegExp
|
|
39
|
+
? pattern.test(file)
|
|
40
|
+
: false);
|
|
41
|
+
if (shouldExclude)
|
|
42
|
+
continue;
|
|
36
43
|
const filePath = path_1.default.join(directory, file);
|
|
37
44
|
// TODO: Symlinks fail here
|
|
38
45
|
const stats = await promises_1.default.stat(filePath);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/file-info/adapters/github/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAE7E,OAAO,EAEL,KAAK,qBAAqB,EAC3B,MAAM,+CAA+C,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/file-info/adapters/github/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAE7E,OAAO,EAEL,KAAK,qBAAqB,EAC3B,MAAM,+CAA+C,CAAC;AAGvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAEjD,wBAAsB,mBAAmB,CAAC,EACxC,KAAK,EACL,QAAQ,EACR,SAAS,EACT,UAAU,EACV,UAAU,GACX,EAAE;IACD,KAAK,EAAE,qBAAqB,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,mBAAmB,CAAC;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB,GAAG,OAAO,CAAC,UAAU,CAAC,CA2BtB"}
|
|
@@ -3,7 +3,7 @@ export declare class GitHubFileReader {
|
|
|
3
3
|
private repoName;
|
|
4
4
|
private apiClient;
|
|
5
5
|
constructor(repoName: string, apiClient: IDashboardAPIClient);
|
|
6
|
-
resolveBranchName(branchName: string | undefined, baseBranch
|
|
6
|
+
resolveBranchName(branchName: string | undefined, baseBranch: string): Promise<string>;
|
|
7
7
|
readFile(filePath: string, branchName: string, baseBranch: string): Promise<FileReadResult | null>;
|
|
8
8
|
private readDirectory;
|
|
9
9
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reader.d.ts","sourceRoot":"","sources":["../../../../src/file-info/adapters/github/reader.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,cAAc,EACd,mBAAmB,EACpB,MAAM,4BAA4B,CAAC;AAcpC,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,
|
|
1
|
+
{"version":3,"file":"reader.d.ts","sourceRoot":"","sources":["../../../../src/file-info/adapters/github/reader.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,cAAc,EACd,mBAAmB,EACpB,MAAM,4BAA4B,CAAC;AAcpC,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"}
|
|
@@ -13,12 +13,11 @@ class GitHubFileReader {
|
|
|
13
13
|
this.repoName = repoName;
|
|
14
14
|
this.apiClient = apiClient;
|
|
15
15
|
}
|
|
16
|
-
async resolveBranchName(branchName, baseBranch
|
|
16
|
+
async resolveBranchName(branchName, baseBranch) {
|
|
17
17
|
if (!branchName || branchName === baseBranch) {
|
|
18
18
|
return baseBranch;
|
|
19
19
|
}
|
|
20
20
|
try {
|
|
21
|
-
// Try to fetch the branch to see if it exists via GitHub proxy
|
|
22
21
|
await this.apiClient.callGitHubProxy({
|
|
23
22
|
method: "GET",
|
|
24
23
|
url: `/repos/empirical-run/${this.repoName}/branches/${branchName}`,
|
|
@@ -27,7 +26,6 @@ class GitHubFileReader {
|
|
|
27
26
|
return branchName;
|
|
28
27
|
}
|
|
29
28
|
catch {
|
|
30
|
-
// Branch doesn't exist, fallback to base branch
|
|
31
29
|
console.log(`[GitHubFileReader] Branch ${branchName} not found, falling back to ${baseBranch}`);
|
|
32
30
|
return baseBranch;
|
|
33
31
|
}
|
|
@@ -95,7 +93,13 @@ class GitHubFileReader {
|
|
|
95
93
|
.map((itemPath) => path_1.default.basename(itemPath))
|
|
96
94
|
.sort()
|
|
97
95
|
.join("\n");
|
|
98
|
-
|
|
96
|
+
if (files.length === 0) {
|
|
97
|
+
// No files means directory is invalid
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
return { content: files, isDirectory: true };
|
|
102
|
+
}
|
|
99
103
|
}
|
|
100
104
|
}
|
|
101
105
|
catch (error) {
|
|
@@ -140,7 +144,6 @@ async function getContentsForDirectory({ repo, path, }, apiClient, branchName) {
|
|
|
140
144
|
return response.data.tree;
|
|
141
145
|
}
|
|
142
146
|
async function getFileInfoFromGitHub(repoName, apiClient, branchName, baseBranchName) {
|
|
143
|
-
// Use GitHubFileReader to resolve the branch
|
|
144
147
|
const fileReader = new GitHubFileReader(repoName, apiClient);
|
|
145
148
|
const resolvedBranch = await fileReader.resolveBranchName(branchName, baseBranchName);
|
|
146
149
|
const files = await getContentsForDirectory({ repo: repoName, path: "" }, apiClient, resolvedBranch);
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAYhD,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAYhD,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EACL,yBAAyB,EACzB,iBAAiB,GAClB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAsBjF,wBAAsB,UAAU,CAC9B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,IAAI,GAAG,YAAY,EAC5B,KAAK,CAAC,EAAE,SAAS,iBA0DlB;AAED,wBAAsB,UAAU,CAAC,OAAO,EAAE,IAAI,iBAY7C"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Tool } from "@empiricalrun/shared-types";
|
|
2
|
+
import type { z } from "zod";
|
|
3
|
+
import { analyseVideoSchema } from "../definitions/analyse-video";
|
|
4
|
+
export declare const analyseVideo: Tool<z.infer<typeof analyseVideoSchema>>;
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/analyse-video/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,IAAI,EAGL,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAK7B,OAAO,EACL,kBAAkB,EAEnB,MAAM,8BAA8B,CAAC;AAiBtC,eAAO,MAAM,YAAY,EAAE,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAsCjE,CAAC"}
|