@harness-engineering/orchestrator 0.2.5 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/index.js +31 -29
- package/dist/index.mjs +30 -28
- package/package.json +4 -5
package/README.md
CHANGED
|
@@ -119,10 +119,10 @@ The main class that ties everything together:
|
|
|
119
119
|
|
|
120
120
|
### Tracker Adapters
|
|
121
121
|
|
|
122
|
-
| Export | Description
|
|
123
|
-
| ------------------------ |
|
|
124
|
-
| `RoadmapTrackerAdapter` | Reads issues from `docs/roadmap.md`
|
|
125
|
-
| `LinearTrackerExtension` | Extends tracking with Linear integration |
|
|
122
|
+
| Export | Description |
|
|
123
|
+
| ------------------------ | ---------------------------------------------------- |
|
|
124
|
+
| `RoadmapTrackerAdapter` | Reads issues from `docs/roadmap.md` |
|
|
125
|
+
| `LinearTrackerExtension` | Extends tracking with Linear integration _(planned)_ |
|
|
126
126
|
|
|
127
127
|
### Prompt Rendering
|
|
128
128
|
|
package/dist/index.js
CHANGED
|
@@ -68,15 +68,20 @@ function calculateRetryDelay(attempt, type, maxRetryBackoffMs = DEFAULT_MAX_RETR
|
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
// src/core/candidate-selection.ts
|
|
71
|
+
function comparePriority(a, b) {
|
|
72
|
+
const pa = a.priority ?? Number.MAX_SAFE_INTEGER;
|
|
73
|
+
const pb = b.priority ?? Number.MAX_SAFE_INTEGER;
|
|
74
|
+
return pa !== pb ? pa - pb : null;
|
|
75
|
+
}
|
|
76
|
+
function compareCreatedAt(a, b) {
|
|
77
|
+
const ca = a.createdAt ?? "\uFFFF";
|
|
78
|
+
const cb = b.createdAt ?? "\uFFFF";
|
|
79
|
+
if (ca === cb) return null;
|
|
80
|
+
return ca < cb ? -1 : 1;
|
|
81
|
+
}
|
|
71
82
|
function sortCandidates(issues) {
|
|
72
83
|
return [...issues].sort((a, b) => {
|
|
73
|
-
|
|
74
|
-
const pb = b.priority ?? Number.MAX_SAFE_INTEGER;
|
|
75
|
-
if (pa !== pb) return pa - pb;
|
|
76
|
-
const ca = a.createdAt ?? "\uFFFF";
|
|
77
|
-
const cb = b.createdAt ?? "\uFFFF";
|
|
78
|
-
if (ca !== cb) return ca < cb ? -1 : 1;
|
|
79
|
-
return a.identifier.localeCompare(b.identifier);
|
|
84
|
+
return comparePriority(a, b) ?? compareCreatedAt(a, b) ?? a.identifier.localeCompare(b.identifier);
|
|
80
85
|
});
|
|
81
86
|
}
|
|
82
87
|
function isEligible(issue, state, activeStates, terminalStates) {
|
|
@@ -760,6 +765,21 @@ var MockBackend = class {
|
|
|
760
765
|
var import_node_child_process2 = require("child_process");
|
|
761
766
|
var readline = __toESM(require("readline"));
|
|
762
767
|
var import_types8 = require("@harness-engineering/types");
|
|
768
|
+
function resolveExitCode(code, command, resolve) {
|
|
769
|
+
if (code === 0) {
|
|
770
|
+
resolve((0, import_types8.Ok)(void 0));
|
|
771
|
+
} else {
|
|
772
|
+
resolve(
|
|
773
|
+
(0, import_types8.Err)({
|
|
774
|
+
category: "agent_not_found",
|
|
775
|
+
message: `Claude command '${command}' not found or failed`
|
|
776
|
+
})
|
|
777
|
+
);
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
function resolveSpawnError(command, resolve) {
|
|
781
|
+
resolve((0, import_types8.Err)({ category: "agent_not_found", message: `Claude command '${command}' not found` }));
|
|
782
|
+
}
|
|
763
783
|
var ClaudeBackend = class {
|
|
764
784
|
name = "claude";
|
|
765
785
|
command;
|
|
@@ -818,26 +838,8 @@ var ClaudeBackend = class {
|
|
|
818
838
|
async healthCheck() {
|
|
819
839
|
return new Promise((resolve) => {
|
|
820
840
|
const child = (0, import_node_child_process2.spawn)(this.command, ["--version"]);
|
|
821
|
-
child.on("exit", (code) =>
|
|
822
|
-
|
|
823
|
-
resolve((0, import_types8.Ok)(void 0));
|
|
824
|
-
} else {
|
|
825
|
-
resolve(
|
|
826
|
-
(0, import_types8.Err)({
|
|
827
|
-
category: "agent_not_found",
|
|
828
|
-
message: `Claude command '${this.command}' not found or failed`
|
|
829
|
-
})
|
|
830
|
-
);
|
|
831
|
-
}
|
|
832
|
-
});
|
|
833
|
-
child.on("error", () => {
|
|
834
|
-
resolve(
|
|
835
|
-
(0, import_types8.Err)({
|
|
836
|
-
category: "agent_not_found",
|
|
837
|
-
message: `Claude command '${this.command}' not found`
|
|
838
|
-
})
|
|
839
|
-
);
|
|
840
|
-
});
|
|
841
|
+
child.on("exit", (code) => resolveExitCode(code, this.command, resolve));
|
|
842
|
+
child.on("error", () => resolveSpawnError(this.command, resolve));
|
|
841
843
|
});
|
|
842
844
|
}
|
|
843
845
|
};
|
|
@@ -866,6 +868,7 @@ var PromptRenderer = class {
|
|
|
866
868
|
|
|
867
869
|
// src/orchestrator.ts
|
|
868
870
|
var import_node_events = require("events");
|
|
871
|
+
var import_core3 = require("@harness-engineering/core");
|
|
869
872
|
|
|
870
873
|
// src/agent/runner.ts
|
|
871
874
|
var AgentRunner = class {
|
|
@@ -1022,7 +1025,6 @@ async function scanWorkspaceConfig(workspacePath) {
|
|
|
1022
1025
|
}
|
|
1023
1026
|
|
|
1024
1027
|
// src/orchestrator.ts
|
|
1025
|
-
var import_core4 = require("@harness-engineering/core");
|
|
1026
1028
|
var Orchestrator = class extends import_node_events.EventEmitter {
|
|
1027
1029
|
state;
|
|
1028
1030
|
config;
|
|
@@ -1171,7 +1173,7 @@ var Orchestrator = class extends import_node_events.EventEmitter {
|
|
|
1171
1173
|
...f.line !== void 0 ? { line: f.line } : {}
|
|
1172
1174
|
}))
|
|
1173
1175
|
);
|
|
1174
|
-
(0,
|
|
1176
|
+
(0, import_core3.writeTaint)(
|
|
1175
1177
|
workspacePath,
|
|
1176
1178
|
issue.id,
|
|
1177
1179
|
"Medium-severity injection patterns found in workspace config files",
|
package/dist/index.mjs
CHANGED
|
@@ -11,15 +11,20 @@ function calculateRetryDelay(attempt, type, maxRetryBackoffMs = DEFAULT_MAX_RETR
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
// src/core/candidate-selection.ts
|
|
14
|
+
function comparePriority(a, b) {
|
|
15
|
+
const pa = a.priority ?? Number.MAX_SAFE_INTEGER;
|
|
16
|
+
const pb = b.priority ?? Number.MAX_SAFE_INTEGER;
|
|
17
|
+
return pa !== pb ? pa - pb : null;
|
|
18
|
+
}
|
|
19
|
+
function compareCreatedAt(a, b) {
|
|
20
|
+
const ca = a.createdAt ?? "\uFFFF";
|
|
21
|
+
const cb = b.createdAt ?? "\uFFFF";
|
|
22
|
+
if (ca === cb) return null;
|
|
23
|
+
return ca < cb ? -1 : 1;
|
|
24
|
+
}
|
|
14
25
|
function sortCandidates(issues) {
|
|
15
26
|
return [...issues].sort((a, b) => {
|
|
16
|
-
|
|
17
|
-
const pb = b.priority ?? Number.MAX_SAFE_INTEGER;
|
|
18
|
-
if (pa !== pb) return pa - pb;
|
|
19
|
-
const ca = a.createdAt ?? "\uFFFF";
|
|
20
|
-
const cb = b.createdAt ?? "\uFFFF";
|
|
21
|
-
if (ca !== cb) return ca < cb ? -1 : 1;
|
|
22
|
-
return a.identifier.localeCompare(b.identifier);
|
|
27
|
+
return comparePriority(a, b) ?? compareCreatedAt(a, b) ?? a.identifier.localeCompare(b.identifier);
|
|
23
28
|
});
|
|
24
29
|
}
|
|
25
30
|
function isEligible(issue, state, activeStates, terminalStates) {
|
|
@@ -711,6 +716,21 @@ import {
|
|
|
711
716
|
Ok as Ok8,
|
|
712
717
|
Err as Err6
|
|
713
718
|
} from "@harness-engineering/types";
|
|
719
|
+
function resolveExitCode(code, command, resolve) {
|
|
720
|
+
if (code === 0) {
|
|
721
|
+
resolve(Ok8(void 0));
|
|
722
|
+
} else {
|
|
723
|
+
resolve(
|
|
724
|
+
Err6({
|
|
725
|
+
category: "agent_not_found",
|
|
726
|
+
message: `Claude command '${command}' not found or failed`
|
|
727
|
+
})
|
|
728
|
+
);
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
function resolveSpawnError(command, resolve) {
|
|
732
|
+
resolve(Err6({ category: "agent_not_found", message: `Claude command '${command}' not found` }));
|
|
733
|
+
}
|
|
714
734
|
var ClaudeBackend = class {
|
|
715
735
|
name = "claude";
|
|
716
736
|
command;
|
|
@@ -769,26 +789,8 @@ var ClaudeBackend = class {
|
|
|
769
789
|
async healthCheck() {
|
|
770
790
|
return new Promise((resolve) => {
|
|
771
791
|
const child = spawn2(this.command, ["--version"]);
|
|
772
|
-
child.on("exit", (code) =>
|
|
773
|
-
|
|
774
|
-
resolve(Ok8(void 0));
|
|
775
|
-
} else {
|
|
776
|
-
resolve(
|
|
777
|
-
Err6({
|
|
778
|
-
category: "agent_not_found",
|
|
779
|
-
message: `Claude command '${this.command}' not found or failed`
|
|
780
|
-
})
|
|
781
|
-
);
|
|
782
|
-
}
|
|
783
|
-
});
|
|
784
|
-
child.on("error", () => {
|
|
785
|
-
resolve(
|
|
786
|
-
Err6({
|
|
787
|
-
category: "agent_not_found",
|
|
788
|
-
message: `Claude command '${this.command}' not found`
|
|
789
|
-
})
|
|
790
|
-
);
|
|
791
|
-
});
|
|
792
|
+
child.on("exit", (code) => resolveExitCode(code, this.command, resolve));
|
|
793
|
+
child.on("error", () => resolveSpawnError(this.command, resolve));
|
|
792
794
|
});
|
|
793
795
|
}
|
|
794
796
|
};
|
|
@@ -817,6 +819,7 @@ var PromptRenderer = class {
|
|
|
817
819
|
|
|
818
820
|
// src/orchestrator.ts
|
|
819
821
|
import { EventEmitter } from "events";
|
|
822
|
+
import { writeTaint } from "@harness-engineering/core";
|
|
820
823
|
|
|
821
824
|
// src/agent/runner.ts
|
|
822
825
|
var AgentRunner = class {
|
|
@@ -981,7 +984,6 @@ async function scanWorkspaceConfig(workspacePath) {
|
|
|
981
984
|
}
|
|
982
985
|
|
|
983
986
|
// src/orchestrator.ts
|
|
984
|
-
import { writeTaint } from "@harness-engineering/core";
|
|
985
987
|
var Orchestrator = class extends EventEmitter {
|
|
986
988
|
state;
|
|
987
989
|
config;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@harness-engineering/orchestrator",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.6",
|
|
4
4
|
"description": "Orchestrator daemon for dispatching coding agents to issues",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -36,13 +36,12 @@
|
|
|
36
36
|
},
|
|
37
37
|
"homepage": "https://github.com/Intense-Visions/harness-engineering/tree/main/packages/orchestrator#readme",
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"chokidar": "^3.6.0",
|
|
40
39
|
"ink": "^4.4.1",
|
|
41
|
-
"liquidjs": "^10.25.
|
|
40
|
+
"liquidjs": "^10.25.3",
|
|
42
41
|
"react": "^18.3.1",
|
|
43
42
|
"yaml": "^2.8.3",
|
|
44
|
-
"@harness-engineering/core": "0.
|
|
45
|
-
"@harness-engineering/types": "0.
|
|
43
|
+
"@harness-engineering/core": "0.21.2",
|
|
44
|
+
"@harness-engineering/types": "0.9.1"
|
|
46
45
|
},
|
|
47
46
|
"devDependencies": {
|
|
48
47
|
"@types/node": "^22.19.15",
|