@zhijiewang/openharness 0.12.1 → 1.2.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/README.md +741 -698
- package/dist/commands/index.js +118 -7
- package/dist/components/InitWizard.js +84 -5
- package/dist/harness/config.d.ts +17 -0
- package/dist/harness/telemetry.d.ts +59 -0
- package/dist/harness/telemetry.js +129 -0
- package/dist/main.js +40 -40
- package/dist/providers/router.d.ts +48 -0
- package/dist/providers/router.js +61 -0
- package/dist/query/compress.d.ts +5 -0
- package/dist/query/compress.js +45 -4
- package/dist/remote/auth.d.ts +25 -0
- package/dist/remote/auth.js +73 -0
- package/dist/remote/server.d.ts +18 -2
- package/dist/remote/server.js +168 -39
- package/dist/renderer/index.d.ts +7 -0
- package/dist/renderer/index.js +33 -5
- package/dist/repl.js +8 -0
- package/dist/services/PipelineExecutor.d.ts +48 -0
- package/dist/services/PipelineExecutor.js +179 -0
- package/dist/services/a2a.d.ts +119 -0
- package/dist/services/a2a.js +176 -0
- package/dist/tools/PipelineTool/index.d.ts +40 -0
- package/dist/tools/PipelineTool/index.js +53 -0
- package/dist/tools/WebFetchTool/index.js +2 -2
- package/dist/tools.js +3 -0
- package/package.json +73 -73
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { PipelineExecutor, formatPipelineResults } from "../../services/PipelineExecutor.js";
|
|
3
|
+
const stepSchema = z.object({
|
|
4
|
+
id: z.string().describe("Unique step identifier"),
|
|
5
|
+
tool: z.string().describe("Tool name to execute (Glob, Grep, Read, Bash, etc.)"),
|
|
6
|
+
args: z.record(z.unknown()).describe("Tool arguments. Use $stepId to reference output of a prior step."),
|
|
7
|
+
dependsOn: z.array(z.string()).optional().describe("Step IDs that must complete before this step runs"),
|
|
8
|
+
});
|
|
9
|
+
const inputSchema = z.object({
|
|
10
|
+
steps: z.array(stepSchema).min(1).describe("Pipeline steps to execute in dependency order"),
|
|
11
|
+
description: z.string().optional().describe("What this pipeline does"),
|
|
12
|
+
});
|
|
13
|
+
export const PipelineTool = {
|
|
14
|
+
name: "Pipeline",
|
|
15
|
+
description: "Execute a declarative multi-step tool pipeline. Steps run in dependency order with variable substitution.",
|
|
16
|
+
inputSchema,
|
|
17
|
+
riskLevel: "medium",
|
|
18
|
+
isReadOnly(input) {
|
|
19
|
+
// Pipeline is read-only only if ALL steps use read-only tools
|
|
20
|
+
// Conservative: assume not read-only
|
|
21
|
+
return false;
|
|
22
|
+
},
|
|
23
|
+
isConcurrencySafe() {
|
|
24
|
+
return false;
|
|
25
|
+
},
|
|
26
|
+
async call(input, context) {
|
|
27
|
+
if (!context.tools) {
|
|
28
|
+
return { output: "Pipeline unavailable: no tools in context.", isError: true };
|
|
29
|
+
}
|
|
30
|
+
const executor = new PipelineExecutor(context.tools, context);
|
|
31
|
+
const results = await executor.execute(input.steps);
|
|
32
|
+
const summary = formatPipelineResults(results);
|
|
33
|
+
const hasErrors = results.some(r => r.isError);
|
|
34
|
+
return { output: summary, isError: hasErrors };
|
|
35
|
+
},
|
|
36
|
+
prompt() {
|
|
37
|
+
return `Execute a declarative multi-step tool pipeline. Each step specifies a tool and its arguments, with optional dependencies on prior steps. Use $stepId in args to reference the output of a completed step.
|
|
38
|
+
|
|
39
|
+
Example:
|
|
40
|
+
{
|
|
41
|
+
"steps": [
|
|
42
|
+
{ "id": "find", "tool": "Glob", "args": { "pattern": "src/**/*.ts" } },
|
|
43
|
+
{ "id": "search", "tool": "Grep", "args": { "pattern": "TODO", "path": "$find" }, "dependsOn": ["find"] }
|
|
44
|
+
],
|
|
45
|
+
"description": "Find all TODO comments in TypeScript files"
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
Parameters:
|
|
49
|
+
- steps (array, required): Pipeline steps with id, tool, args, and optional dependsOn
|
|
50
|
+
- description (string, optional): What this pipeline does`;
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -95,8 +95,8 @@ export const WebFetchTool = {
|
|
|
95
95
|
}
|
|
96
96
|
},
|
|
97
97
|
prompt() {
|
|
98
|
-
return `Fetch a URL and return its text content. Parameters:
|
|
99
|
-
- url (string, required): The URL to fetch (http/https only).
|
|
98
|
+
return `Fetch a URL and return its text content. Parameters:
|
|
99
|
+
- url (string, required): The URL to fetch (http/https only).
|
|
100
100
|
HTML tags are stripped. Output is truncated at 50K characters. Private/internal hosts are blocked for security.`;
|
|
101
101
|
},
|
|
102
102
|
};
|
package/dist/tools.js
CHANGED
|
@@ -41,6 +41,7 @@ import { ExitWorktreeTool } from "./tools/ExitWorktreeTool/index.js";
|
|
|
41
41
|
import { KillProcessTool } from "./tools/KillProcessTool/index.js";
|
|
42
42
|
import { RemoteTriggerTool } from "./tools/RemoteTriggerTool/index.js";
|
|
43
43
|
import { MultiEditTool } from "./tools/MultiEditTool/index.js";
|
|
44
|
+
import { PipelineTool } from "./tools/PipelineTool/index.js";
|
|
44
45
|
/**
|
|
45
46
|
* Returns all registered tools.
|
|
46
47
|
*
|
|
@@ -71,6 +72,8 @@ export function getAllTools() {
|
|
|
71
72
|
ExitPlanModeTool,
|
|
72
73
|
// Tool Discovery
|
|
73
74
|
ToolSearchTool,
|
|
75
|
+
// Pipelines
|
|
76
|
+
PipelineTool,
|
|
74
77
|
// Memory management
|
|
75
78
|
MemoryTool,
|
|
76
79
|
];
|
package/package.json
CHANGED
|
@@ -1,73 +1,73 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@zhijiewang/openharness",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Open-source terminal coding agent. Works with any LLM.",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"bin": {
|
|
7
|
-
"openharness": "./dist/main.js",
|
|
8
|
-
"oh": "./dist/main.js"
|
|
9
|
-
},
|
|
10
|
-
"main": "./dist/main.js",
|
|
11
|
-
"files": [
|
|
12
|
-
"dist/**/*.js",
|
|
13
|
-
"dist/**/*.d.ts",
|
|
14
|
-
"!dist/**/*.test.*",
|
|
15
|
-
"!dist/**/test-helpers.*",
|
|
16
|
-
"README.md",
|
|
17
|
-
"LICENSE"
|
|
18
|
-
],
|
|
19
|
-
"scripts": {
|
|
20
|
-
"dev": "tsx src/main.tsx",
|
|
21
|
-
"build": "tsc",
|
|
22
|
-
"prepare": "tsc",
|
|
23
|
-
"prepublishOnly": "npm run build",
|
|
24
|
-
"test": "node scripts/test.mjs",
|
|
25
|
-
"test:coverage": "node scripts/coverage.mjs",
|
|
26
|
-
"typecheck": "tsc --noEmit",
|
|
27
|
-
"start": "node dist/main.js"
|
|
28
|
-
},
|
|
29
|
-
"dependencies": {
|
|
30
|
-
"@types/marked": "^5.0.2",
|
|
31
|
-
"chalk": "^5.4.1",
|
|
32
|
-
"commander": "^13.0.0",
|
|
33
|
-
"ink": "^5.2.0",
|
|
34
|
-
"ink-spinner": "^5.0.0",
|
|
35
|
-
"ink-text-input": "^6.0.0",
|
|
36
|
-
"marked": "^17.0.5",
|
|
37
|
-
"react": "^18.3.1",
|
|
38
|
-
"yaml": "^2.7.0",
|
|
39
|
-
"zod": "^3.24.0"
|
|
40
|
-
},
|
|
41
|
-
"devDependencies": {
|
|
42
|
-
"@types/node": "^22.0.0",
|
|
43
|
-
"@types/react": "^18.3.0",
|
|
44
|
-
"c8": "^11.0.0",
|
|
45
|
-
"sharp": "^0.34.5",
|
|
46
|
-
"tsx": "^4.19.0",
|
|
47
|
-
"typescript": "^5.8.0"
|
|
48
|
-
},
|
|
49
|
-
"engines": {
|
|
50
|
-
"node": ">=18.0.0"
|
|
51
|
-
},
|
|
52
|
-
"keywords": [
|
|
53
|
-
"ai",
|
|
54
|
-
"agent",
|
|
55
|
-
"llm",
|
|
56
|
-
"cli",
|
|
57
|
-
"coding-agent",
|
|
58
|
-
"terminal",
|
|
59
|
-
"coding-assistant",
|
|
60
|
-
"ollama",
|
|
61
|
-
"openai",
|
|
62
|
-
"anthropic"
|
|
63
|
-
],
|
|
64
|
-
"license": "MIT",
|
|
65
|
-
"repository": {
|
|
66
|
-
"type": "git",
|
|
67
|
-
"url": "https://github.com/zhijiewong/openharness"
|
|
68
|
-
},
|
|
69
|
-
"bugs": {
|
|
70
|
-
"url": "https://github.com/zhijiewong/openharness/issues"
|
|
71
|
-
},
|
|
72
|
-
"homepage": "https://github.com/zhijiewong/openharness#readme"
|
|
73
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@zhijiewang/openharness",
|
|
3
|
+
"version": "1.2.0",
|
|
4
|
+
"description": "Open-source terminal coding agent. Works with any LLM.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"openharness": "./dist/main.js",
|
|
8
|
+
"oh": "./dist/main.js"
|
|
9
|
+
},
|
|
10
|
+
"main": "./dist/main.js",
|
|
11
|
+
"files": [
|
|
12
|
+
"dist/**/*.js",
|
|
13
|
+
"dist/**/*.d.ts",
|
|
14
|
+
"!dist/**/*.test.*",
|
|
15
|
+
"!dist/**/test-helpers.*",
|
|
16
|
+
"README.md",
|
|
17
|
+
"LICENSE"
|
|
18
|
+
],
|
|
19
|
+
"scripts": {
|
|
20
|
+
"dev": "tsx src/main.tsx",
|
|
21
|
+
"build": "tsc",
|
|
22
|
+
"prepare": "tsc",
|
|
23
|
+
"prepublishOnly": "npm run build",
|
|
24
|
+
"test": "node scripts/test.mjs",
|
|
25
|
+
"test:coverage": "node scripts/coverage.mjs",
|
|
26
|
+
"typecheck": "tsc --noEmit",
|
|
27
|
+
"start": "node dist/main.js"
|
|
28
|
+
},
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@types/marked": "^5.0.2",
|
|
31
|
+
"chalk": "^5.4.1",
|
|
32
|
+
"commander": "^13.0.0",
|
|
33
|
+
"ink": "^5.2.0",
|
|
34
|
+
"ink-spinner": "^5.0.0",
|
|
35
|
+
"ink-text-input": "^6.0.0",
|
|
36
|
+
"marked": "^17.0.5",
|
|
37
|
+
"react": "^18.3.1",
|
|
38
|
+
"yaml": "^2.7.0",
|
|
39
|
+
"zod": "^3.24.0"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@types/node": "^22.0.0",
|
|
43
|
+
"@types/react": "^18.3.0",
|
|
44
|
+
"c8": "^11.0.0",
|
|
45
|
+
"sharp": "^0.34.5",
|
|
46
|
+
"tsx": "^4.19.0",
|
|
47
|
+
"typescript": "^5.8.0"
|
|
48
|
+
},
|
|
49
|
+
"engines": {
|
|
50
|
+
"node": ">=18.0.0"
|
|
51
|
+
},
|
|
52
|
+
"keywords": [
|
|
53
|
+
"ai",
|
|
54
|
+
"agent",
|
|
55
|
+
"llm",
|
|
56
|
+
"cli",
|
|
57
|
+
"coding-agent",
|
|
58
|
+
"terminal",
|
|
59
|
+
"coding-assistant",
|
|
60
|
+
"ollama",
|
|
61
|
+
"openai",
|
|
62
|
+
"anthropic"
|
|
63
|
+
],
|
|
64
|
+
"license": "MIT",
|
|
65
|
+
"repository": {
|
|
66
|
+
"type": "git",
|
|
67
|
+
"url": "https://github.com/zhijiewong/openharness"
|
|
68
|
+
},
|
|
69
|
+
"bugs": {
|
|
70
|
+
"url": "https://github.com/zhijiewong/openharness/issues"
|
|
71
|
+
},
|
|
72
|
+
"homepage": "https://github.com/zhijiewong/openharness#readme"
|
|
73
|
+
}
|