@sudocode-ai/local-server 0.1.7 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/dist/errors/agent-errors.d.ts +43 -0
- package/dist/errors/agent-errors.d.ts.map +1 -0
- package/dist/errors/agent-errors.js +69 -0
- package/dist/errors/agent-errors.js.map +1 -0
- package/dist/execution/adapters/claude-adapter.d.ts +63 -0
- package/dist/execution/adapters/claude-adapter.d.ts.map +1 -0
- package/dist/execution/adapters/claude-adapter.js +82 -0
- package/dist/execution/adapters/claude-adapter.js.map +1 -0
- package/dist/execution/adapters/codex-adapter.d.ts +67 -0
- package/dist/execution/adapters/codex-adapter.d.ts.map +1 -0
- package/dist/execution/adapters/codex-adapter.js +183 -0
- package/dist/execution/adapters/codex-adapter.js.map +1 -0
- package/dist/execution/adapters/codex-config-builder.d.ts +30 -0
- package/dist/execution/adapters/codex-config-builder.d.ts.map +1 -0
- package/dist/execution/adapters/codex-config-builder.js +110 -0
- package/dist/execution/adapters/codex-config-builder.js.map +1 -0
- package/dist/execution/adapters/copilot-adapter.d.ts +94 -0
- package/dist/execution/adapters/copilot-adapter.d.ts.map +1 -0
- package/dist/execution/adapters/copilot-adapter.js +163 -0
- package/dist/execution/adapters/copilot-adapter.js.map +1 -0
- package/dist/execution/adapters/copilot-config-builder.d.ts +48 -0
- package/dist/execution/adapters/copilot-config-builder.d.ts.map +1 -0
- package/dist/execution/adapters/copilot-config-builder.js +125 -0
- package/dist/execution/adapters/copilot-config-builder.js.map +1 -0
- package/dist/execution/adapters/cursor-adapter.d.ts +66 -0
- package/dist/execution/adapters/cursor-adapter.d.ts.map +1 -0
- package/dist/execution/adapters/cursor-adapter.js +121 -0
- package/dist/execution/adapters/cursor-adapter.js.map +1 -0
- package/dist/execution/adapters/cursor-config-builder.d.ts +29 -0
- package/dist/execution/adapters/cursor-config-builder.d.ts.map +1 -0
- package/dist/execution/adapters/cursor-config-builder.js +49 -0
- package/dist/execution/adapters/cursor-config-builder.js.map +1 -0
- package/dist/execution/adapters/shared/config-presets.d.ts +102 -0
- package/dist/execution/adapters/shared/config-presets.d.ts.map +1 -0
- package/dist/execution/adapters/shared/config-presets.js +205 -0
- package/dist/execution/adapters/shared/config-presets.js.map +1 -0
- package/dist/execution/adapters/shared/config-utils.d.ts +95 -0
- package/dist/execution/adapters/shared/config-utils.d.ts.map +1 -0
- package/dist/execution/adapters/shared/config-utils.js +163 -0
- package/dist/execution/adapters/shared/config-utils.js.map +1 -0
- package/dist/execution/adapters/shared/index.d.ts +8 -0
- package/dist/execution/adapters/shared/index.d.ts.map +1 -0
- package/dist/execution/adapters/shared/index.js +8 -0
- package/dist/execution/adapters/shared/index.js.map +1 -0
- package/dist/execution/executors/agent-executor-wrapper.d.ts +153 -0
- package/dist/execution/executors/agent-executor-wrapper.d.ts.map +1 -0
- package/dist/execution/executors/agent-executor-wrapper.js +652 -0
- package/dist/execution/executors/agent-executor-wrapper.js.map +1 -0
- package/dist/execution/executors/executor-factory.d.ts +95 -0
- package/dist/execution/executors/executor-factory.d.ts.map +1 -0
- package/dist/execution/executors/executor-factory.js +120 -0
- package/dist/execution/executors/executor-factory.js.map +1 -0
- package/dist/execution/output/ag-ui-adapter.d.ts +0 -2
- package/dist/execution/output/ag-ui-adapter.d.ts.map +1 -1
- package/dist/execution/output/ag-ui-adapter.js +0 -2
- package/dist/execution/output/ag-ui-adapter.js.map +1 -1
- package/dist/execution/output/index.d.ts +0 -3
- package/dist/execution/output/index.d.ts.map +1 -1
- package/dist/execution/output/index.js +0 -2
- package/dist/execution/output/index.js.map +1 -1
- package/dist/execution/output/normalized-to-ag-ui-adapter.d.ts +108 -0
- package/dist/execution/output/normalized-to-ag-ui-adapter.d.ts.map +1 -0
- package/dist/execution/output/normalized-to-ag-ui-adapter.js +321 -0
- package/dist/execution/output/normalized-to-ag-ui-adapter.js.map +1 -0
- package/dist/execution/process/builders/claude.d.ts +24 -57
- package/dist/execution/process/builders/claude.d.ts.map +1 -1
- package/dist/execution/process/builders/claude.js +153 -19
- package/dist/execution/process/builders/claude.js.map +1 -1
- package/dist/execution/transport/ipc-transport-manager.d.ts +74 -0
- package/dist/execution/transport/ipc-transport-manager.d.ts.map +1 -0
- package/dist/execution/transport/ipc-transport-manager.js +104 -0
- package/dist/execution/transport/ipc-transport-manager.js.map +1 -0
- package/dist/execution/transport/transport-manager.d.ts.map +1 -1
- package/dist/execution/transport/transport-manager.js +3 -0
- package/dist/execution/transport/transport-manager.js.map +1 -1
- package/dist/execution/worktree/conflict-detector.d.ts +85 -0
- package/dist/execution/worktree/conflict-detector.d.ts.map +1 -0
- package/dist/execution/worktree/conflict-detector.js +129 -0
- package/dist/execution/worktree/conflict-detector.js.map +1 -0
- package/dist/execution/worktree/git-cli.d.ts +9 -0
- package/dist/execution/worktree/git-cli.d.ts.map +1 -1
- package/dist/execution/worktree/git-cli.js +10 -0
- package/dist/execution/worktree/git-cli.js.map +1 -1
- package/dist/execution/worktree/git-sync-cli.d.ts +187 -0
- package/dist/execution/worktree/git-sync-cli.d.ts.map +1 -0
- package/dist/execution/worktree/git-sync-cli.js +350 -0
- package/dist/execution/worktree/git-sync-cli.js.map +1 -0
- package/dist/execution/worktree/manager.d.ts +18 -0
- package/dist/execution/worktree/manager.d.ts.map +1 -1
- package/dist/execution/worktree/manager.js +9 -3
- package/dist/execution/worktree/manager.js.map +1 -1
- package/dist/index.d.ts +1 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +132 -211
- package/dist/index.js.map +1 -1
- package/dist/middleware/project-context.d.ts +37 -0
- package/dist/middleware/project-context.d.ts.map +1 -0
- package/dist/middleware/project-context.js +91 -0
- package/dist/middleware/project-context.js.map +1 -0
- package/dist/public/assets/index-Bb_W5bUr.css +1 -0
- package/dist/public/assets/index-CFKL113G.js +710 -0
- package/dist/public/assets/index-CFKL113G.js.map +1 -0
- package/dist/public/assets/{react-vendor-ByUx1V_q.js → react-vendor-DiL5hC7l.js} +2 -2
- package/dist/public/assets/{react-vendor-ByUx1V_q.js.map → react-vendor-DiL5hC7l.js.map} +1 -1
- package/dist/public/assets/ui-vendor-B4WMPEfa.js +54 -0
- package/dist/public/assets/ui-vendor-B4WMPEfa.js.map +1 -0
- package/dist/public/index.html +4 -4
- package/dist/routes/agents.d.ts +3 -0
- package/dist/routes/agents.d.ts.map +1 -0
- package/dist/routes/agents.js +62 -0
- package/dist/routes/agents.js.map +1 -0
- package/dist/routes/config.d.ts +3 -0
- package/dist/routes/config.d.ts.map +1 -0
- package/dist/routes/config.js +25 -0
- package/dist/routes/config.js.map +1 -0
- package/dist/routes/editors.d.ts +15 -0
- package/dist/routes/editors.d.ts.map +1 -0
- package/dist/routes/editors.js +98 -0
- package/dist/routes/editors.js.map +1 -0
- package/dist/routes/executions-stream.d.ts +8 -5
- package/dist/routes/executions-stream.d.ts.map +1 -1
- package/dist/routes/executions-stream.js +10 -6
- package/dist/routes/executions-stream.js.map +1 -1
- package/dist/routes/executions.d.ts +6 -10
- package/dist/routes/executions.d.ts.map +1 -1
- package/dist/routes/executions.js +506 -54
- package/dist/routes/executions.js.map +1 -1
- package/dist/routes/feedback.d.ts +3 -2
- package/dist/routes/feedback.d.ts.map +1 -1
- package/dist/routes/feedback.js +12 -10
- package/dist/routes/feedback.js.map +1 -1
- package/dist/routes/files.d.ts +18 -0
- package/dist/routes/files.d.ts.map +1 -0
- package/dist/routes/files.js +89 -0
- package/dist/routes/files.js.map +1 -0
- package/dist/routes/issues.d.ts +3 -2
- package/dist/routes/issues.d.ts.map +1 -1
- package/dist/routes/issues.js +19 -18
- package/dist/routes/issues.js.map +1 -1
- package/dist/routes/projects.d.ts +11 -0
- package/dist/routes/projects.d.ts.map +1 -0
- package/dist/routes/projects.js +447 -0
- package/dist/routes/projects.js.map +1 -0
- package/dist/routes/relationships.d.ts +3 -2
- package/dist/routes/relationships.d.ts.map +1 -1
- package/dist/routes/relationships.js +12 -10
- package/dist/routes/relationships.js.map +1 -1
- package/dist/routes/repo-info.d.ts +3 -0
- package/dist/routes/repo-info.d.ts.map +1 -0
- package/dist/routes/repo-info.js +126 -0
- package/dist/routes/repo-info.js.map +1 -0
- package/dist/routes/specs.d.ts +3 -2
- package/dist/routes/specs.d.ts.map +1 -1
- package/dist/routes/specs.js +19 -18
- package/dist/routes/specs.js.map +1 -1
- package/dist/services/agent-registry.d.ts +140 -0
- package/dist/services/agent-registry.d.ts.map +1 -0
- package/dist/services/agent-registry.js +272 -0
- package/dist/services/agent-registry.js.map +1 -0
- package/dist/services/editor-service.d.ts +57 -0
- package/dist/services/editor-service.d.ts.map +1 -0
- package/dist/services/editor-service.js +204 -0
- package/dist/services/editor-service.js.map +1 -0
- package/dist/services/execution-changes-service.d.ts +92 -0
- package/dist/services/execution-changes-service.d.ts.map +1 -0
- package/dist/services/execution-changes-service.js +546 -0
- package/dist/services/execution-changes-service.js.map +1 -0
- package/dist/services/execution-lifecycle.d.ts +1 -0
- package/dist/services/execution-lifecycle.d.ts.map +1 -1
- package/dist/services/execution-lifecycle.js +37 -7
- package/dist/services/execution-lifecycle.js.map +1 -1
- package/dist/services/execution-logs-store.d.ts +75 -0
- package/dist/services/execution-logs-store.d.ts.map +1 -1
- package/dist/services/execution-logs-store.js +142 -2
- package/dist/services/execution-logs-store.js.map +1 -1
- package/dist/services/execution-service.d.ts +50 -58
- package/dist/services/execution-service.d.ts.map +1 -1
- package/dist/services/execution-service.js +433 -469
- package/dist/services/execution-service.js.map +1 -1
- package/dist/services/execution-worker-pool.d.ts +116 -0
- package/dist/services/execution-worker-pool.d.ts.map +1 -0
- package/dist/services/execution-worker-pool.js +326 -0
- package/dist/services/execution-worker-pool.js.map +1 -0
- package/dist/services/executions.d.ts +3 -0
- package/dist/services/executions.d.ts.map +1 -1
- package/dist/services/executions.js +11 -17
- package/dist/services/executions.js.map +1 -1
- package/dist/services/export.d.ts +8 -2
- package/dist/services/export.d.ts.map +1 -1
- package/dist/services/export.js +29 -23
- package/dist/services/export.js.map +1 -1
- package/dist/services/file-search/git-ls-files-strategy.d.ts +72 -0
- package/dist/services/file-search/git-ls-files-strategy.d.ts.map +1 -0
- package/dist/services/file-search/git-ls-files-strategy.js +176 -0
- package/dist/services/file-search/git-ls-files-strategy.js.map +1 -0
- package/dist/services/file-search/index.d.ts +9 -0
- package/dist/services/file-search/index.d.ts.map +1 -0
- package/dist/services/file-search/index.js +10 -0
- package/dist/services/file-search/index.js.map +1 -0
- package/dist/services/file-search/registry.d.ts +97 -0
- package/dist/services/file-search/registry.d.ts.map +1 -0
- package/dist/services/file-search/registry.js +140 -0
- package/dist/services/file-search/registry.js.map +1 -0
- package/dist/services/file-search/strategy.d.ts +58 -0
- package/dist/services/file-search/strategy.d.ts.map +1 -0
- package/dist/services/file-search/strategy.js +8 -0
- package/dist/services/file-search/strategy.js.map +1 -0
- package/dist/services/project-context.d.ts +69 -0
- package/dist/services/project-context.d.ts.map +1 -0
- package/dist/services/project-context.js +113 -0
- package/dist/services/project-context.js.map +1 -0
- package/dist/services/project-manager.d.ts +95 -0
- package/dist/services/project-manager.d.ts.map +1 -0
- package/dist/services/project-manager.js +388 -0
- package/dist/services/project-manager.js.map +1 -0
- package/dist/services/project-registry.d.ts +98 -0
- package/dist/services/project-registry.d.ts.map +1 -0
- package/dist/services/project-registry.js +289 -0
- package/dist/services/project-registry.js.map +1 -0
- package/dist/services/prompt-resolver.d.ts +97 -0
- package/dist/services/prompt-resolver.d.ts.map +1 -0
- package/dist/services/prompt-resolver.js +377 -0
- package/dist/services/prompt-resolver.js.map +1 -0
- package/dist/services/repo-info.d.ts +12 -0
- package/dist/services/repo-info.d.ts.map +1 -1
- package/dist/services/repo-info.js +46 -0
- package/dist/services/repo-info.js.map +1 -1
- package/dist/services/watcher.d.ts +3 -4
- package/dist/services/watcher.d.ts.map +1 -1
- package/dist/services/watcher.js +18 -35
- package/dist/services/watcher.js.map +1 -1
- package/dist/services/websocket.d.ts +30 -16
- package/dist/services/websocket.d.ts.map +1 -1
- package/dist/services/websocket.js +102 -37
- package/dist/services/websocket.js.map +1 -1
- package/dist/services/worktree-sync-service.d.ts +228 -0
- package/dist/services/worktree-sync-service.d.ts.map +1 -0
- package/dist/services/worktree-sync-service.js +563 -0
- package/dist/services/worktree-sync-service.js.map +1 -0
- package/dist/types/editor.d.ts +49 -0
- package/dist/types/editor.d.ts.map +1 -0
- package/dist/types/editor.js +50 -0
- package/dist/types/editor.js.map +1 -0
- package/dist/types/project.d.ts +58 -0
- package/dist/types/project.d.ts.map +1 -0
- package/dist/types/project.js +10 -0
- package/dist/types/project.js.map +1 -0
- package/dist/utils/executable-check.d.ts +36 -0
- package/dist/utils/executable-check.d.ts.map +1 -0
- package/dist/utils/executable-check.js +79 -0
- package/dist/utils/executable-check.js.map +1 -0
- package/dist/workers/execution-worker.d.ts +18 -0
- package/dist/workers/execution-worker.d.ts.map +1 -0
- package/dist/workers/execution-worker.js +340 -0
- package/dist/workers/execution-worker.js.map +1 -0
- package/dist/workers/worker-ipc.d.ts +84 -0
- package/dist/workers/worker-ipc.d.ts.map +1 -0
- package/dist/workers/worker-ipc.js +29 -0
- package/dist/workers/worker-ipc.js.map +1 -0
- package/package.json +6 -5
- package/dist/execution/output/ag-ui-integration.d.ts +0 -96
- package/dist/execution/output/ag-ui-integration.d.ts.map +0 -1
- package/dist/execution/output/ag-ui-integration.js +0 -96
- package/dist/execution/output/ag-ui-integration.js.map +0 -1
- package/dist/execution/output/claude-code-output-processor.d.ts +0 -321
- package/dist/execution/output/claude-code-output-processor.d.ts.map +0 -1
- package/dist/execution/output/claude-code-output-processor.js +0 -769
- package/dist/execution/output/claude-code-output-processor.js.map +0 -1
- package/dist/public/assets/index-B3SEMufD.js +0 -580
- package/dist/public/assets/index-B3SEMufD.js.map +0 -1
- package/dist/public/assets/index-D2YGL3gX.css +0 -1
- package/dist/public/assets/ui-vendor-CotR6bx9.js +0 -54
- package/dist/public/assets/ui-vendor-CotR6bx9.js.map +0 -1
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Editor types and configuration for IDE opening functionality
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Supported editor types for opening worktrees
|
|
6
|
+
*/
|
|
7
|
+
export var EditorType;
|
|
8
|
+
(function (EditorType) {
|
|
9
|
+
EditorType["VS_CODE"] = "vs-code";
|
|
10
|
+
EditorType["CURSOR"] = "cursor";
|
|
11
|
+
EditorType["WINDSURF"] = "windsurf";
|
|
12
|
+
EditorType["INTELLIJ"] = "intellij";
|
|
13
|
+
EditorType["ZED"] = "zed";
|
|
14
|
+
EditorType["XCODE"] = "xcode";
|
|
15
|
+
EditorType["CUSTOM"] = "custom";
|
|
16
|
+
})(EditorType || (EditorType = {}));
|
|
17
|
+
/**
|
|
18
|
+
* Custom error class for editor opening failures
|
|
19
|
+
* Provides structured error information for API responses
|
|
20
|
+
*/
|
|
21
|
+
export class EditorOpenError extends Error {
|
|
22
|
+
code;
|
|
23
|
+
editorType;
|
|
24
|
+
details;
|
|
25
|
+
constructor(code, editorType, message, details) {
|
|
26
|
+
super(message);
|
|
27
|
+
this.code = code;
|
|
28
|
+
this.editorType = editorType;
|
|
29
|
+
this.details = details;
|
|
30
|
+
this.name = "EditorOpenError";
|
|
31
|
+
// Maintains proper stack trace for where error was thrown (V8 only)
|
|
32
|
+
if (Error.captureStackTrace) {
|
|
33
|
+
Error.captureStackTrace(this, EditorOpenError);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Convert error to JSON for API responses
|
|
38
|
+
*/
|
|
39
|
+
toJSON() {
|
|
40
|
+
return {
|
|
41
|
+
error: {
|
|
42
|
+
code: this.code,
|
|
43
|
+
message: this.message,
|
|
44
|
+
details: this.details,
|
|
45
|
+
editorType: this.editorType,
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=editor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor.js","sourceRoot":"","sources":["../../src/types/editor.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,CAAN,IAAY,UAQX;AARD,WAAY,UAAU;IACpB,iCAAmB,CAAA;IACnB,+BAAiB,CAAA;IACjB,mCAAqB,CAAA;IACrB,mCAAqB,CAAA;IACrB,yBAAW,CAAA;IACX,6BAAe,CAAA;IACf,+BAAiB,CAAA;AACnB,CAAC,EARW,UAAU,KAAV,UAAU,QAQrB;AAmBD;;;GAGG;AACH,MAAM,OAAO,eAAgB,SAAQ,KAAK;IAE/B;IACA;IAEA;IAJT,YACS,IAAqB,EACrB,UAAsB,EAC7B,OAAe,EACR,OAAgB;QAEvB,KAAK,CAAC,OAAO,CAAC,CAAC;QALR,SAAI,GAAJ,IAAI,CAAiB;QACrB,eAAU,GAAV,UAAU,CAAY;QAEtB,YAAO,GAAP,OAAO,CAAS;QAGvB,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;QAE9B,oEAAoE;QACpE,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;YAC5B,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;QACjD,CAAC;IACH,CAAC;IAED;;OAEG;IACH,MAAM;QACJ,OAAO;YACL,KAAK,EAAE;gBACL,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,UAAU,EAAE,IAAI,CAAC,UAAU;aAC5B;SACF,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Project-related types for multi-project server support
|
|
3
|
+
*/
|
|
4
|
+
export interface ProjectInfo {
|
|
5
|
+
/** Unique project identifier (deterministic hash-based) */
|
|
6
|
+
id: string;
|
|
7
|
+
/** Human-readable project name (derived from repository name) */
|
|
8
|
+
name: string;
|
|
9
|
+
/** Absolute path to the project root directory */
|
|
10
|
+
path: string;
|
|
11
|
+
/** Absolute path to the .sudocode directory */
|
|
12
|
+
sudocodeDir: string;
|
|
13
|
+
/** ISO timestamp when project was first registered */
|
|
14
|
+
registeredAt: string;
|
|
15
|
+
/** ISO timestamp when project was last opened */
|
|
16
|
+
lastOpenedAt: string;
|
|
17
|
+
/** Whether this project is marked as favorite */
|
|
18
|
+
favorite: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface ProjectsConfig {
|
|
21
|
+
/** Config schema version for future migrations */
|
|
22
|
+
version: number;
|
|
23
|
+
/** Map of project ID to project info */
|
|
24
|
+
projects: Record<string, ProjectInfo>;
|
|
25
|
+
/** Ordered list of recently opened project IDs (most recent first) */
|
|
26
|
+
recentProjects: string[];
|
|
27
|
+
/** User settings for project management */
|
|
28
|
+
settings: {
|
|
29
|
+
/** Maximum number of projects to keep in recent list */
|
|
30
|
+
maxRecentProjects: number;
|
|
31
|
+
/** Whether to automatically open the last opened project on server start */
|
|
32
|
+
autoOpenLastProject: boolean;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export type ProjectError = {
|
|
36
|
+
type: 'PATH_NOT_FOUND';
|
|
37
|
+
path: string;
|
|
38
|
+
} | {
|
|
39
|
+
type: 'INVALID_PROJECT';
|
|
40
|
+
message: string;
|
|
41
|
+
} | {
|
|
42
|
+
type: 'PERMISSION_DENIED';
|
|
43
|
+
path: string;
|
|
44
|
+
} | {
|
|
45
|
+
type: 'CONFIG_CORRUPTED';
|
|
46
|
+
message: string;
|
|
47
|
+
} | {
|
|
48
|
+
type: 'UNKNOWN';
|
|
49
|
+
message: string;
|
|
50
|
+
};
|
|
51
|
+
export interface Result<T, E> {
|
|
52
|
+
ok: boolean;
|
|
53
|
+
value?: T;
|
|
54
|
+
error?: E;
|
|
55
|
+
}
|
|
56
|
+
export declare function Ok<T>(value: T): Result<T, never>;
|
|
57
|
+
export declare function Err<E>(error: E): Result<never, E>;
|
|
58
|
+
//# source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WAAW,MAAM,CAAC,CAAC,EAAE,CAAC;IAC1B,EAAE,EAAE,OAAO,CAAA;IACX,KAAK,CAAC,EAAE,CAAC,CAAA;IACT,KAAK,CAAC,EAAE,CAAC,CAAA;CACV;AAED,wBAAgB,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,CAEhD;AAED,wBAAgB,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAEjD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project.js","sourceRoot":"","sources":["../../src/types/project.ts"],"names":[],"mappings":"AAAA;;GAEG;AAgDH,MAAM,UAAU,EAAE,CAAI,KAAQ;IAC5B,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAA;AAC5B,CAAC;AAED,MAAM,UAAU,GAAG,CAAI,KAAQ;IAC7B,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;AAC7B,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Executable Check Utilities
|
|
3
|
+
*
|
|
4
|
+
* Utilities for verifying if executables are available on the system.
|
|
5
|
+
* Used for checking if agent CLIs (claude, copilot, etc.) are installed.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Result of an executable verification check
|
|
9
|
+
*/
|
|
10
|
+
export interface VerificationResult {
|
|
11
|
+
/** Whether the executable is available */
|
|
12
|
+
available: boolean;
|
|
13
|
+
/** Path to the executable if found */
|
|
14
|
+
path?: string;
|
|
15
|
+
/** Version information if available */
|
|
16
|
+
version?: string;
|
|
17
|
+
/** Error message if verification failed */
|
|
18
|
+
error?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Check if an executable exists in PATH
|
|
22
|
+
*
|
|
23
|
+
* @param executableName - Name of the executable (e.g., 'claude', 'copilot')
|
|
24
|
+
* @returns Promise<VerificationResult>
|
|
25
|
+
*/
|
|
26
|
+
export declare function verifyExecutable(executableName: string): Promise<VerificationResult>;
|
|
27
|
+
/**
|
|
28
|
+
* Verify an executable and attempt to get its version
|
|
29
|
+
*
|
|
30
|
+
* @param executableName - Name of the executable
|
|
31
|
+
* @param versionArgs - Arguments to pass to get version (e.g., ['--version'])
|
|
32
|
+
* @param timeout - Timeout in milliseconds (default: 5000)
|
|
33
|
+
* @returns Promise<VerificationResult>
|
|
34
|
+
*/
|
|
35
|
+
export declare function verifyExecutableWithVersion(executableName: string, versionArgs?: string[], timeout?: number): Promise<VerificationResult>;
|
|
36
|
+
//# sourceMappingURL=executable-check.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executable-check.d.ts","sourceRoot":"","sources":["../../src/utils/executable-check.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,0CAA0C;IAC1C,SAAS,EAAE,OAAO,CAAC;IACnB,sCAAsC;IACtC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uCAAuC;IACvC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,2CAA2C;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;GAKG;AACH,wBAAsB,gBAAgB,CACpC,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,kBAAkB,CAAC,CAsB7B;AAED;;;;;;;GAOG;AACH,wBAAsB,2BAA2B,CAC/C,cAAc,EAAE,MAAM,EACtB,WAAW,GAAE,MAAM,EAAkB,EACrC,OAAO,GAAE,MAAa,GACrB,OAAO,CAAC,kBAAkB,CAAC,CAsC7B"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Executable Check Utilities
|
|
3
|
+
*
|
|
4
|
+
* Utilities for verifying if executables are available on the system.
|
|
5
|
+
* Used for checking if agent CLIs (claude, copilot, etc.) are installed.
|
|
6
|
+
*/
|
|
7
|
+
import { execFile } from 'child_process';
|
|
8
|
+
import { promisify } from 'util';
|
|
9
|
+
import * as which from 'which';
|
|
10
|
+
const execFileAsync = promisify(execFile);
|
|
11
|
+
/**
|
|
12
|
+
* Check if an executable exists in PATH
|
|
13
|
+
*
|
|
14
|
+
* @param executableName - Name of the executable (e.g., 'claude', 'copilot')
|
|
15
|
+
* @returns Promise<VerificationResult>
|
|
16
|
+
*/
|
|
17
|
+
export async function verifyExecutable(executableName) {
|
|
18
|
+
try {
|
|
19
|
+
// Use 'which' to find the executable in PATH
|
|
20
|
+
const executablePath = await which.default(executableName);
|
|
21
|
+
if (!executablePath) {
|
|
22
|
+
return {
|
|
23
|
+
available: false,
|
|
24
|
+
error: `Executable '${executableName}' not found in PATH`,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
return {
|
|
28
|
+
available: true,
|
|
29
|
+
path: executablePath,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
return {
|
|
34
|
+
available: false,
|
|
35
|
+
error: `Executable '${executableName}' not found in PATH`,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Verify an executable and attempt to get its version
|
|
41
|
+
*
|
|
42
|
+
* @param executableName - Name of the executable
|
|
43
|
+
* @param versionArgs - Arguments to pass to get version (e.g., ['--version'])
|
|
44
|
+
* @param timeout - Timeout in milliseconds (default: 5000)
|
|
45
|
+
* @returns Promise<VerificationResult>
|
|
46
|
+
*/
|
|
47
|
+
export async function verifyExecutableWithVersion(executableName, versionArgs = ['--version'], timeout = 5000) {
|
|
48
|
+
// First check if executable exists
|
|
49
|
+
const basicCheck = await verifyExecutable(executableName);
|
|
50
|
+
if (!basicCheck.available) {
|
|
51
|
+
return basicCheck;
|
|
52
|
+
}
|
|
53
|
+
// Try to get version info
|
|
54
|
+
try {
|
|
55
|
+
const { stdout, stderr } = await execFileAsync(executableName, versionArgs, {
|
|
56
|
+
timeout,
|
|
57
|
+
encoding: 'utf8',
|
|
58
|
+
});
|
|
59
|
+
// Version info is usually in stdout, but some tools use stderr
|
|
60
|
+
const versionOutput = (stdout || stderr).trim();
|
|
61
|
+
return {
|
|
62
|
+
available: true,
|
|
63
|
+
path: basicCheck.path,
|
|
64
|
+
version: versionOutput || 'unknown',
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
catch (error) {
|
|
68
|
+
// Even if version check fails, the executable exists
|
|
69
|
+
return {
|
|
70
|
+
available: true,
|
|
71
|
+
path: basicCheck.path,
|
|
72
|
+
version: 'unknown',
|
|
73
|
+
error: error instanceof Error
|
|
74
|
+
? `Version check failed: ${error.message}`
|
|
75
|
+
: 'Version check failed',
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=executable-check.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executable-check.js","sourceRoot":"","sources":["../../src/utils/executable-check.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACjC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,aAAa,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;AAgB1C;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,cAAsB;IAEtB,IAAI,CAAC;QACH,6CAA6C;QAC7C,MAAM,cAAc,GAAG,MAAM,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;QAE3D,IAAI,CAAC,cAAc,EAAE,CAAC;YACpB,OAAO;gBACL,SAAS,EAAE,KAAK;gBAChB,KAAK,EAAE,eAAe,cAAc,qBAAqB;aAC1D,CAAC;QACJ,CAAC;QAED,OAAO;YACL,SAAS,EA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process Entry Point
|
|
3
|
+
*
|
|
4
|
+
* Standalone Node.js process that runs Claude Code executions in isolation.
|
|
5
|
+
* Communicates with main process via IPC (Inter-Process Communication).
|
|
6
|
+
*
|
|
7
|
+
* Environment Variables:
|
|
8
|
+
* - EXECUTION_ID: Execution record ID
|
|
9
|
+
* - PROJECT_ID: Project identifier
|
|
10
|
+
* - REPO_PATH: Path to git repository
|
|
11
|
+
* - DB_PATH: Path to SQLite database
|
|
12
|
+
* - WORKER_ID: Unique worker identifier
|
|
13
|
+
* - MAX_MEMORY_MB: Memory limit (for logging)
|
|
14
|
+
*
|
|
15
|
+
* @module workers/execution-worker
|
|
16
|
+
*/
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=execution-worker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execution-worker.d.ts","sourceRoot":"","sources":["../../src/workers/execution-worker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG"}
|
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Execution Worker Process Entry Point
|
|
3
|
+
*
|
|
4
|
+
* Standalone Node.js process that runs Claude Code executions in isolation.
|
|
5
|
+
* Communicates with main process via IPC (Inter-Process Communication).
|
|
6
|
+
*
|
|
7
|
+
* Environment Variables:
|
|
8
|
+
* - EXECUTION_ID: Execution record ID
|
|
9
|
+
* - PROJECT_ID: Project identifier
|
|
10
|
+
* - REPO_PATH: Path to git repository
|
|
11
|
+
* - DB_PATH: Path to SQLite database
|
|
12
|
+
* - WORKER_ID: Unique worker identifier
|
|
13
|
+
* - MAX_MEMORY_MB: Memory limit (for logging)
|
|
14
|
+
*
|
|
15
|
+
* @module workers/execution-worker
|
|
16
|
+
*/
|
|
17
|
+
import Database from "better-sqlite3";
|
|
18
|
+
import { isMainMessage } from "./worker-ipc.js";
|
|
19
|
+
import { createExecutorForAgent } from "../execution/executors/executor-factory.js";
|
|
20
|
+
import { ExecutionLifecycleService } from "../services/execution-lifecycle.js";
|
|
21
|
+
import { ExecutionLogsStore } from "../services/execution-logs-store.js";
|
|
22
|
+
import { IpcTransportManager } from "../execution/transport/ipc-transport-manager.js";
|
|
23
|
+
import { getExecution, updateExecution } from "../services/executions.js";
|
|
24
|
+
// Validate required environment variables
|
|
25
|
+
const EXECUTION_ID = process.env.EXECUTION_ID;
|
|
26
|
+
const PROJECT_ID = process.env.PROJECT_ID;
|
|
27
|
+
const REPO_PATH = process.env.REPO_PATH;
|
|
28
|
+
const DB_PATH = process.env.DB_PATH;
|
|
29
|
+
const WORKER_ID = process.env.WORKER_ID;
|
|
30
|
+
const MAX_MEMORY_MB = process.env.MAX_MEMORY_MB;
|
|
31
|
+
if (!EXECUTION_ID || !PROJECT_ID || !REPO_PATH || !DB_PATH || !WORKER_ID) {
|
|
32
|
+
console.error("[Worker] Missing required environment variables");
|
|
33
|
+
process.exit(1);
|
|
34
|
+
}
|
|
35
|
+
console.log(`[Worker:${WORKER_ID}] Starting execution worker for ${EXECUTION_ID}`);
|
|
36
|
+
/**
|
|
37
|
+
* Send IPC message to main process
|
|
38
|
+
*/
|
|
39
|
+
function sendToMain(message) {
|
|
40
|
+
if (!process.send) {
|
|
41
|
+
console.error("[Worker] IPC not available (process.send is undefined)");
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
try {
|
|
45
|
+
process.send(message);
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
console.error("[Worker] Failed to send IPC message:", error);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Send log event to main process
|
|
53
|
+
* Note: Currently unused as AgentExecutorWrapper handles log storage directly.
|
|
54
|
+
* Kept for backward compatibility with IPC protocol.
|
|
55
|
+
*/
|
|
56
|
+
// function sendLog(data: OutputEvent): void {
|
|
57
|
+
// sendToMain({
|
|
58
|
+
// type: "log",
|
|
59
|
+
// executionId: EXECUTION_ID!,
|
|
60
|
+
// data,
|
|
61
|
+
// });
|
|
62
|
+
// }
|
|
63
|
+
/**
|
|
64
|
+
* Send status update to main process
|
|
65
|
+
*/
|
|
66
|
+
function sendStatus(status) {
|
|
67
|
+
sendToMain({
|
|
68
|
+
type: "status",
|
|
69
|
+
executionId: EXECUTION_ID,
|
|
70
|
+
status: status,
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Send completion result to main process
|
|
75
|
+
*/
|
|
76
|
+
function sendComplete(result) {
|
|
77
|
+
sendToMain({
|
|
78
|
+
type: "complete",
|
|
79
|
+
executionId: EXECUTION_ID,
|
|
80
|
+
result,
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Send error to main process
|
|
85
|
+
*/
|
|
86
|
+
function sendError(error, fatal = false) {
|
|
87
|
+
sendToMain({
|
|
88
|
+
type: "error",
|
|
89
|
+
executionId: EXECUTION_ID,
|
|
90
|
+
error,
|
|
91
|
+
fatal,
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Flag to track if execution should be canceled
|
|
96
|
+
*/
|
|
97
|
+
let cancelRequested = false;
|
|
98
|
+
/**
|
|
99
|
+
* Listen for messages from main process
|
|
100
|
+
*/
|
|
101
|
+
process.on("message", (message) => {
|
|
102
|
+
if (!isMainMessage(message)) {
|
|
103
|
+
console.warn("[Worker] Received invalid message from main:", message);
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
switch (message.type) {
|
|
107
|
+
case "cancel":
|
|
108
|
+
console.log(`[Worker:${WORKER_ID}] Cancel requested`);
|
|
109
|
+
cancelRequested = true;
|
|
110
|
+
// Orchestrator will handle graceful cancellation
|
|
111
|
+
break;
|
|
112
|
+
case "ping":
|
|
113
|
+
// Health check - just acknowledge
|
|
114
|
+
console.log(`[Worker:${WORKER_ID}] Ping received`);
|
|
115
|
+
break;
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
/**
|
|
119
|
+
* Main execution function
|
|
120
|
+
*/
|
|
121
|
+
async function runExecution() {
|
|
122
|
+
let db = null;
|
|
123
|
+
try {
|
|
124
|
+
// 1. Initialize database connection
|
|
125
|
+
console.log(`[Worker:${WORKER_ID}] Connecting to database: ${DB_PATH}`);
|
|
126
|
+
db = new Database(DB_PATH);
|
|
127
|
+
// 2. Load execution record
|
|
128
|
+
const execution = getExecution(db, EXECUTION_ID);
|
|
129
|
+
if (!execution) {
|
|
130
|
+
throw new Error(`Execution ${EXECUTION_ID} not found in database`);
|
|
131
|
+
}
|
|
132
|
+
console.log(`[Worker:${WORKER_ID}] Loaded execution:`, {
|
|
133
|
+
id: execution.id,
|
|
134
|
+
issueId: execution.issue_id,
|
|
135
|
+
mode: execution.mode,
|
|
136
|
+
status: execution.status,
|
|
137
|
+
});
|
|
138
|
+
// 3. Parse execution config
|
|
139
|
+
const config = execution.config ? JSON.parse(execution.config) : {};
|
|
140
|
+
const prompt = execution.prompt || "";
|
|
141
|
+
if (!prompt.trim()) {
|
|
142
|
+
throw new Error("Execution prompt is empty");
|
|
143
|
+
}
|
|
144
|
+
// 4. Determine work directory
|
|
145
|
+
const workDir = execution.mode === "worktree"
|
|
146
|
+
? execution.worktree_path || REPO_PATH
|
|
147
|
+
: REPO_PATH;
|
|
148
|
+
console.log(`[Worker:${WORKER_ID}] Work directory: ${workDir}`);
|
|
149
|
+
// 4.5. Validate worktree exists for worktree mode
|
|
150
|
+
if (execution.mode === "worktree" && execution.worktree_path) {
|
|
151
|
+
const fs = await import("fs/promises");
|
|
152
|
+
const path = await import("path");
|
|
153
|
+
try {
|
|
154
|
+
// Check if worktree path exists
|
|
155
|
+
const stats = await fs.stat(execution.worktree_path);
|
|
156
|
+
if (!stats.isDirectory()) {
|
|
157
|
+
throw new Error(`Worktree path is not a directory: ${execution.worktree_path}`);
|
|
158
|
+
}
|
|
159
|
+
// Check if it's a valid git directory
|
|
160
|
+
const gitPath = path.join(execution.worktree_path, ".git");
|
|
161
|
+
await fs.access(gitPath);
|
|
162
|
+
console.log(`[Worker:${WORKER_ID}] Worktree validation passed`);
|
|
163
|
+
}
|
|
164
|
+
catch (error) {
|
|
165
|
+
// Provide clear error messages based on error code
|
|
166
|
+
let errorMessage;
|
|
167
|
+
if (error.code === "ENOENT") {
|
|
168
|
+
errorMessage = `Worktree was deleted or does not exist at: ${execution.worktree_path}`;
|
|
169
|
+
}
|
|
170
|
+
else if (error.code === "ENOTDIR") {
|
|
171
|
+
errorMessage = `Worktree path is not a valid directory: ${execution.worktree_path}`;
|
|
172
|
+
}
|
|
173
|
+
else if (error.code === "EACCES") {
|
|
174
|
+
errorMessage = `Permission denied accessing worktree: ${execution.worktree_path}`;
|
|
175
|
+
}
|
|
176
|
+
else {
|
|
177
|
+
errorMessage = `Failed to access worktree: ${error.message}`;
|
|
178
|
+
}
|
|
179
|
+
console.error(`[Worker:${WORKER_ID}] ${errorMessage}`);
|
|
180
|
+
// Attempt to recreate worktree
|
|
181
|
+
console.log(`[Worker:${WORKER_ID}] Attempting to recreate worktree...`);
|
|
182
|
+
try {
|
|
183
|
+
const lifecycleService = new ExecutionLifecycleService(db, REPO_PATH);
|
|
184
|
+
const worktreeManager = lifecycleService.worktreeManager;
|
|
185
|
+
await worktreeManager.createWorktree({
|
|
186
|
+
repoPath: REPO_PATH,
|
|
187
|
+
branchName: execution.branch_name,
|
|
188
|
+
worktreePath: execution.worktree_path,
|
|
189
|
+
baseBranch: execution.target_branch,
|
|
190
|
+
createBranch: false, // Branch should already exist
|
|
191
|
+
});
|
|
192
|
+
console.log(`[Worker:${WORKER_ID}] Successfully recreated worktree`);
|
|
193
|
+
}
|
|
194
|
+
catch (recreateError) {
|
|
195
|
+
// Failed to recreate - this is a fatal error
|
|
196
|
+
throw new Error(`${errorMessage}. Failed to recreate worktree: ${recreateError.message}`);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
// 5. Send ready signal
|
|
201
|
+
sendToMain({
|
|
202
|
+
type: "ready",
|
|
203
|
+
executionId: EXECUTION_ID,
|
|
204
|
+
workerId: WORKER_ID,
|
|
205
|
+
});
|
|
206
|
+
// 6. Create services for AgentExecutorWrapper
|
|
207
|
+
const lifecycleService = new ExecutionLifecycleService(db, REPO_PATH);
|
|
208
|
+
const logsStore = new ExecutionLogsStore(db);
|
|
209
|
+
// 7. Create IPC transport manager to forward AG-UI events
|
|
210
|
+
const ipcTransport = new IpcTransportManager(EXECUTION_ID);
|
|
211
|
+
// 8. Determine agent type (default to claude-code for backwards compatibility)
|
|
212
|
+
const agentType = config.agentType || "claude-code";
|
|
213
|
+
// 9. Create executor using factory
|
|
214
|
+
const wrapper = createExecutorForAgent(agentType, { workDir: REPO_PATH, ...config }, {
|
|
215
|
+
workDir: REPO_PATH,
|
|
216
|
+
lifecycleService,
|
|
217
|
+
logsStore,
|
|
218
|
+
projectId: PROJECT_ID,
|
|
219
|
+
db,
|
|
220
|
+
transportManager: ipcTransport, // IpcTransportManager matches interface
|
|
221
|
+
});
|
|
222
|
+
// 10. Build execution task
|
|
223
|
+
const task = {
|
|
224
|
+
id: execution.id,
|
|
225
|
+
type: "issue",
|
|
226
|
+
entityId: execution.issue_id || undefined,
|
|
227
|
+
prompt: prompt,
|
|
228
|
+
workDir: workDir,
|
|
229
|
+
config: {
|
|
230
|
+
timeout: config.timeout,
|
|
231
|
+
},
|
|
232
|
+
metadata: {
|
|
233
|
+
model: config.model || "claude-sonnet-4",
|
|
234
|
+
captureFileChanges: config.captureFileChanges ?? true,
|
|
235
|
+
captureToolCalls: config.captureToolCalls ?? true,
|
|
236
|
+
issueId: execution.issue_id,
|
|
237
|
+
executionId: execution.id,
|
|
238
|
+
},
|
|
239
|
+
priority: 0,
|
|
240
|
+
dependencies: [],
|
|
241
|
+
createdAt: new Date(),
|
|
242
|
+
};
|
|
243
|
+
// 11. Update status to running
|
|
244
|
+
console.log(`[Worker:${WORKER_ID}] Starting execution with AgentExecutorWrapper (${agentType})`);
|
|
245
|
+
sendStatus("running");
|
|
246
|
+
// 12. Execute with lifecycle management (blocking)
|
|
247
|
+
const startTime = Date.now();
|
|
248
|
+
await wrapper.executeWithLifecycle(execution.id, task, workDir);
|
|
249
|
+
const duration = Date.now() - startTime;
|
|
250
|
+
console.log(`[Worker:${WORKER_ID}] Execution completed in ${duration}ms`);
|
|
251
|
+
// 13. Check if cancellation was requested
|
|
252
|
+
if (cancelRequested) {
|
|
253
|
+
console.log(`[Worker:${WORKER_ID}] Execution was cancelled`);
|
|
254
|
+
updateExecution(db, execution.id, {
|
|
255
|
+
status: "cancelled",
|
|
256
|
+
completed_at: new Date().toISOString(),
|
|
257
|
+
});
|
|
258
|
+
sendComplete({
|
|
259
|
+
status: "cancelled",
|
|
260
|
+
exitCode: 0,
|
|
261
|
+
completedAt: new Date().toISOString(),
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
else {
|
|
265
|
+
// Send completion (wrapper already updated DB and broadcast)
|
|
266
|
+
sendComplete({
|
|
267
|
+
status: "completed",
|
|
268
|
+
exitCode: 0,
|
|
269
|
+
completedAt: new Date().toISOString(),
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
console.log(`[Worker:${WORKER_ID}] Execution completed successfully`);
|
|
273
|
+
}
|
|
274
|
+
catch (error) {
|
|
275
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
276
|
+
console.error(`[Worker:${WORKER_ID}] Execution failed:`, errorMessage);
|
|
277
|
+
// Wrapper already updated DB and broadcast, just send IPC message
|
|
278
|
+
sendError(errorMessage, true);
|
|
279
|
+
// Exit with failure code
|
|
280
|
+
process.exit(1);
|
|
281
|
+
}
|
|
282
|
+
finally {
|
|
283
|
+
// Clean up database connection
|
|
284
|
+
if (db) {
|
|
285
|
+
try {
|
|
286
|
+
db.close();
|
|
287
|
+
console.log(`[Worker:${WORKER_ID}] Database connection closed`);
|
|
288
|
+
}
|
|
289
|
+
catch (error) {
|
|
290
|
+
console.error(`[Worker:${WORKER_ID}] Error closing database:`, error);
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Global error handlers
|
|
297
|
+
*/
|
|
298
|
+
process.on("uncaughtException", (error) => {
|
|
299
|
+
console.error(`[Worker:${WORKER_ID}] Uncaught exception:`, error);
|
|
300
|
+
sendError(`Uncaught exception: ${error.message}`, true);
|
|
301
|
+
process.exit(1);
|
|
302
|
+
});
|
|
303
|
+
process.on("unhandledRejection", (reason) => {
|
|
304
|
+
console.error(`[Worker:${WORKER_ID}] Unhandled rejection:`, reason);
|
|
305
|
+
sendError(`Unhandled rejection: ${String(reason)}`, true);
|
|
306
|
+
process.exit(1);
|
|
307
|
+
});
|
|
308
|
+
/**
|
|
309
|
+
* Graceful shutdown handlers
|
|
310
|
+
*/
|
|
311
|
+
process.on("SIGTERM", () => {
|
|
312
|
+
console.log(`[Worker:${WORKER_ID}] Received SIGTERM, shutting down gracefully`);
|
|
313
|
+
cancelRequested = true;
|
|
314
|
+
// Let the orchestrator handle graceful shutdown
|
|
315
|
+
setTimeout(() => {
|
|
316
|
+
console.log(`[Worker:${WORKER_ID}] Force exit after grace period`);
|
|
317
|
+
process.exit(0);
|
|
318
|
+
}, 5000);
|
|
319
|
+
});
|
|
320
|
+
process.on("SIGINT", () => {
|
|
321
|
+
console.log(`[Worker:${WORKER_ID}] Received SIGINT, shutting down gracefully`);
|
|
322
|
+
cancelRequested = true;
|
|
323
|
+
setTimeout(() => {
|
|
324
|
+
process.exit(0);
|
|
325
|
+
}, 5000);
|
|
326
|
+
});
|
|
327
|
+
// Start execution
|
|
328
|
+
console.log(`[Worker:${WORKER_ID}] Worker process initialized`);
|
|
329
|
+
console.log(`[Worker:${WORKER_ID}] Memory limit: ${MAX_MEMORY_MB || "default"} MB`);
|
|
330
|
+
console.log(`[Worker:${WORKER_ID}] PID: ${process.pid}`);
|
|
331
|
+
runExecution()
|
|
332
|
+
.then(() => {
|
|
333
|
+
console.log(`[Worker:${WORKER_ID}] Worker exiting normally`);
|
|
334
|
+
process.exit(0);
|
|
335
|
+
})
|
|
336
|
+
.catch((error) => {
|
|
337
|
+
console.error(`[Worker:${WORKER_ID}] Worker exiting with error:`, error);
|
|
338
|
+
process.exit(1);
|
|
339
|
+
});
|
|
340
|
+
//# sourceMappingURL=execution-worker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execution-worker.js","sourceRoot":"","sources":["../../src/workers/execution-worker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AAMtC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,OAAO,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AACpF,OAAO,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAC;AAC/E,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iDAAiD,CAAC;AACtF,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAE1E,0CAA0C;AAC1C,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC;AAC9C,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC;AAC1C,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC;AACxC,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;AACpC,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC;AACxC,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC;AAEhD,IAAI,CAAC,YAAY,IAAI,CAAC,UAAU,IAAI,CAAC,SAAS,IAAI,CAAC,OAAO,IAAI,CAAC,SAAS,EAAE,CAAC;IACzE,OAAO,CAAC,KAAK,CAAC,iDAAiD,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