@zhijiewang/openharness 0.2.0 → 0.3.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.
Files changed (157) hide show
  1. package/README.md +256 -160
  2. package/dist/Tool.d.ts +3 -1
  3. package/dist/Tool.d.ts.map +1 -1
  4. package/dist/Tool.js +1 -1
  5. package/dist/Tool.js.map +1 -1
  6. package/dist/commands/cybergotchi.d.ts +3 -0
  7. package/dist/commands/cybergotchi.d.ts.map +1 -0
  8. package/dist/commands/cybergotchi.js +75 -0
  9. package/dist/commands/cybergotchi.js.map +1 -0
  10. package/dist/commands/index.d.ts +2 -0
  11. package/dist/commands/index.d.ts.map +1 -1
  12. package/dist/commands/index.js +45 -0
  13. package/dist/commands/index.js.map +1 -1
  14. package/dist/components/CybergotchiBubble.d.ts +7 -0
  15. package/dist/components/CybergotchiBubble.d.ts.map +1 -0
  16. package/dist/components/CybergotchiBubble.js +27 -0
  17. package/dist/components/CybergotchiBubble.js.map +1 -0
  18. package/dist/components/CybergotchiPanel.d.ts +8 -0
  19. package/dist/components/CybergotchiPanel.d.ts.map +1 -0
  20. package/dist/components/CybergotchiPanel.js +15 -0
  21. package/dist/components/CybergotchiPanel.js.map +1 -0
  22. package/dist/components/CybergotchiSetup.d.ts +7 -0
  23. package/dist/components/CybergotchiSetup.d.ts.map +1 -0
  24. package/dist/components/CybergotchiSetup.js +80 -0
  25. package/dist/components/CybergotchiSetup.js.map +1 -0
  26. package/dist/components/CybergotchiSprite.d.ts +8 -0
  27. package/dist/components/CybergotchiSprite.d.ts.map +1 -0
  28. package/dist/components/CybergotchiSprite.js +20 -0
  29. package/dist/components/CybergotchiSprite.js.map +1 -0
  30. package/dist/components/InitWizard.d.ts +18 -0
  31. package/dist/components/InitWizard.d.ts.map +1 -0
  32. package/dist/components/InitWizard.js +151 -0
  33. package/dist/components/InitWizard.js.map +1 -0
  34. package/dist/components/REPL.d.ts.map +1 -1
  35. package/dist/components/REPL.js +91 -3
  36. package/dist/components/REPL.js.map +1 -1
  37. package/dist/components/ToolCallDisplay.d.ts +1 -0
  38. package/dist/components/ToolCallDisplay.d.ts.map +1 -1
  39. package/dist/components/ToolCallDisplay.js +8 -2
  40. package/dist/components/ToolCallDisplay.js.map +1 -1
  41. package/dist/cybergotchi/config.d.ts +5 -0
  42. package/dist/cybergotchi/config.d.ts.map +1 -0
  43. package/dist/cybergotchi/config.js +48 -0
  44. package/dist/cybergotchi/config.js.map +1 -0
  45. package/dist/cybergotchi/events.d.ts +15 -0
  46. package/dist/cybergotchi/events.d.ts.map +1 -0
  47. package/dist/cybergotchi/events.js +14 -0
  48. package/dist/cybergotchi/events.js.map +1 -0
  49. package/dist/cybergotchi/needs.d.ts +10 -0
  50. package/dist/cybergotchi/needs.d.ts.map +1 -0
  51. package/dist/cybergotchi/needs.js +83 -0
  52. package/dist/cybergotchi/needs.js.map +1 -0
  53. package/dist/cybergotchi/species.d.ts +11 -0
  54. package/dist/cybergotchi/species.d.ts.map +1 -0
  55. package/dist/cybergotchi/species.js +356 -0
  56. package/dist/cybergotchi/species.js.map +1 -0
  57. package/dist/cybergotchi/speech.d.ts +4 -0
  58. package/dist/cybergotchi/speech.d.ts.map +1 -0
  59. package/dist/cybergotchi/speech.js +80 -0
  60. package/dist/cybergotchi/speech.js.map +1 -0
  61. package/dist/cybergotchi/types.d.ts +39 -0
  62. package/dist/cybergotchi/types.d.ts.map +1 -0
  63. package/dist/cybergotchi/types.js +29 -0
  64. package/dist/cybergotchi/types.js.map +1 -0
  65. package/dist/cybergotchi/useCybergotchi.d.ts +10 -0
  66. package/dist/cybergotchi/useCybergotchi.d.ts.map +1 -0
  67. package/dist/cybergotchi/useCybergotchi.js +99 -0
  68. package/dist/cybergotchi/useCybergotchi.js.map +1 -0
  69. package/dist/harness/config.d.ts +14 -0
  70. package/dist/harness/config.d.ts.map +1 -0
  71. package/dist/harness/config.js +24 -0
  72. package/dist/harness/config.js.map +1 -0
  73. package/dist/harness/cost.d.ts +4 -0
  74. package/dist/harness/cost.d.ts.map +1 -1
  75. package/dist/harness/cost.js +20 -0
  76. package/dist/harness/cost.js.map +1 -1
  77. package/dist/main.js +26 -16
  78. package/dist/main.js.map +1 -1
  79. package/dist/mcp/McpTool.d.ts +19 -0
  80. package/dist/mcp/McpTool.d.ts.map +1 -0
  81. package/dist/mcp/McpTool.js +40 -0
  82. package/dist/mcp/McpTool.js.map +1 -0
  83. package/dist/mcp/client.d.ts +15 -0
  84. package/dist/mcp/client.d.ts.map +1 -0
  85. package/dist/mcp/client.js +78 -0
  86. package/dist/mcp/client.js.map +1 -0
  87. package/dist/mcp/loader.d.ts +8 -0
  88. package/dist/mcp/loader.d.ts.map +1 -0
  89. package/dist/mcp/loader.js +52 -0
  90. package/dist/mcp/loader.js.map +1 -0
  91. package/dist/mcp/types.d.ts +35 -0
  92. package/dist/mcp/types.d.ts.map +1 -0
  93. package/dist/mcp/types.js +3 -0
  94. package/dist/mcp/types.js.map +1 -0
  95. package/dist/providers/anthropic.d.ts.map +1 -1
  96. package/dist/providers/anthropic.js +17 -6
  97. package/dist/providers/anthropic.js.map +1 -1
  98. package/dist/providers/index.d.ts +4 -2
  99. package/dist/providers/index.d.ts.map +1 -1
  100. package/dist/providers/index.js +3 -1
  101. package/dist/providers/index.js.map +1 -1
  102. package/dist/providers/openai.d.ts.map +1 -1
  103. package/dist/providers/openai.js +16 -5
  104. package/dist/providers/openai.js.map +1 -1
  105. package/dist/query.d.ts +1 -1
  106. package/dist/query.d.ts.map +1 -1
  107. package/dist/query.js +17 -3
  108. package/dist/query.js.map +1 -1
  109. package/dist/services/StreamingToolExecutor.d.ts +6 -2
  110. package/dist/services/StreamingToolExecutor.d.ts.map +1 -1
  111. package/dist/services/StreamingToolExecutor.js +11 -4
  112. package/dist/services/StreamingToolExecutor.js.map +1 -1
  113. package/dist/tools/BashTool/index.d.ts.map +1 -1
  114. package/dist/tools/BashTool/index.js +10 -2
  115. package/dist/tools/BashTool/index.js.map +1 -1
  116. package/dist/tools/ImageReadTool/index.d.ts +13 -0
  117. package/dist/tools/ImageReadTool/index.d.ts.map +1 -0
  118. package/dist/tools/ImageReadTool/index.js +59 -0
  119. package/dist/tools/ImageReadTool/index.js.map +1 -0
  120. package/dist/tools.d.ts.map +1 -1
  121. package/dist/tools.js +2 -0
  122. package/dist/tools.js.map +1 -1
  123. package/dist/types/events.d.ts +6 -1
  124. package/dist/types/events.d.ts.map +1 -1
  125. package/dist/types/message.d.ts +1 -1
  126. package/dist/types/message.js +1 -1
  127. package/dist/types/permissions.d.ts +2 -2
  128. package/dist/types/permissions.js +2 -2
  129. package/dist/utils/theme.d.ts +1 -1
  130. package/dist/utils/theme.js +1 -1
  131. package/package.json +9 -3
  132. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -27
  133. package/.github/ISSUE_TEMPLATE/feature_request.md +0 -17
  134. package/.github/pull_request_template.md +0 -24
  135. package/.github/workflows/ci.yml +0 -31
  136. package/CHANGELOG.md +0 -18
  137. package/CODE_OF_CONDUCT.md +0 -43
  138. package/CONTRIBUTING.md +0 -55
  139. package/SECURITY.md +0 -21
  140. package/data/models.json +0 -74
  141. package/data/prompts/system.md +0 -25
  142. package/data/skills/code-review.md +0 -19
  143. package/data/skills/commit.md +0 -17
  144. package/data/skills/debug.md +0 -24
  145. package/data/skills/tdd.md +0 -22
  146. package/dist/components/StatusBar.d.ts +0 -7
  147. package/dist/components/StatusBar.d.ts.map +0 -1
  148. package/dist/components/StatusBar.js +0 -6
  149. package/dist/components/StatusBar.js.map +0 -1
  150. package/dist/utils/retry.d.ts +0 -10
  151. package/dist/utils/retry.d.ts.map +0 -1
  152. package/dist/utils/retry.js +0 -23
  153. package/dist/utils/retry.js.map +0 -1
  154. package/dist/utils/tokens.d.ts +0 -18
  155. package/dist/utils/tokens.d.ts.map +0 -1
  156. package/dist/utils/tokens.js +0 -57
  157. package/dist/utils/tokens.js.map +0 -1
@@ -0,0 +1,59 @@
1
+ import { z } from "zod";
2
+ import * as fs from "fs/promises";
3
+ import * as path from "path";
4
+ const SUPPORTED_TYPES = {
5
+ ".png": "image/png",
6
+ ".jpg": "image/jpeg",
7
+ ".jpeg": "image/jpeg",
8
+ ".gif": "image/gif",
9
+ ".webp": "image/webp",
10
+ ".pdf": "application/pdf",
11
+ };
12
+ const inputSchema = z.object({
13
+ file_path: z.string(),
14
+ });
15
+ export const IMAGE_PREFIX = "__IMAGE__";
16
+ export const ImageReadTool = {
17
+ name: "ImageRead",
18
+ description: "Read an image file and return it as base64 for multimodal analysis.",
19
+ inputSchema,
20
+ riskLevel: "low",
21
+ isReadOnly() {
22
+ return true;
23
+ },
24
+ isConcurrencySafe() {
25
+ return true;
26
+ },
27
+ async call(input, context) {
28
+ const filePath = path.isAbsolute(input.file_path)
29
+ ? input.file_path
30
+ : path.resolve(context.workingDir, input.file_path);
31
+ const ext = path.extname(filePath).toLowerCase();
32
+ const mediaType = SUPPORTED_TYPES[ext];
33
+ if (!mediaType) {
34
+ return {
35
+ output: `Unsupported image type: ${ext}. Supported: ${Object.keys(SUPPORTED_TYPES).join(", ")}`,
36
+ isError: true,
37
+ };
38
+ }
39
+ try {
40
+ const buffer = await fs.readFile(filePath);
41
+ const base64 = buffer.toString("base64");
42
+ return {
43
+ output: `${IMAGE_PREFIX}:${mediaType}:${base64}`,
44
+ isError: false,
45
+ };
46
+ }
47
+ catch (err) {
48
+ if (err.code === "ENOENT") {
49
+ return { output: `File not found: ${filePath}`, isError: true };
50
+ }
51
+ return { output: `Error reading image: ${err.message}`, isError: true };
52
+ }
53
+ },
54
+ prompt() {
55
+ return `Read an image or PDF file and send it to the model for visual analysis. Parameters:
56
+ - file_path (string, required): Path to an image file (.png, .jpg, .jpeg, .gif, .webp, .pdf).`;
57
+ },
58
+ };
59
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/ImageReadTool/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,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F,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;QAED,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;YAC3C,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;YACzC,OAAO;gBACL,MAAM,EAAE,GAAG,YAAY,IAAI,SAAS,IAAI,MAAM,EAAE;gBAChD,OAAO,EAAE,KAAK;aACf,CAAC;QACJ,CAAC;QAAC,OAAO,GAAQ,EAAE,CAAC;YAClB,IAAI,GAAG,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;gBAC1B,OAAO,EAAE,MAAM,EAAE,mBAAmB,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;YAClE,CAAC;YACD,OAAO,EAAE,MAAM,EAAE,wBAAwB,GAAG,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;QAC1E,CAAC;IACH,CAAC;IAED,MAAM;QACJ,OAAO;8FACmF,CAAC;IAC7F,CAAC;CACF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAuBvC;;GAEG;AACH,wBAAgB,WAAW,IAAI,KAAK,CAyBnC"}
1
+ {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAwBvC;;GAEG;AACH,wBAAgB,WAAW,IAAI,KAAK,CA0BnC"}
package/dist/tools.js CHANGED
@@ -20,6 +20,7 @@ import { AgentTool } from "./tools/AgentTool/index.js";
20
20
  import { EnterPlanModeTool } from "./tools/EnterPlanModeTool/index.js";
21
21
  import { ExitPlanModeTool } from "./tools/ExitPlanModeTool/index.js";
22
22
  import { NotebookEditTool } from "./tools/NotebookEditTool/index.js";
23
+ import { ImageReadTool } from "./tools/ImageReadTool/index.js";
23
24
  /**
24
25
  * Returns all registered tools.
25
26
  */
@@ -28,6 +29,7 @@ export function getAllTools() {
28
29
  // Core (always available)
29
30
  BashTool,
30
31
  FileReadTool,
32
+ ImageReadTool,
31
33
  FileWriteTool,
32
34
  FileEditTool,
33
35
  GlobTool,
package/dist/tools.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"tools.js","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,aAAa;AACb,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAE7D,iBAAiB;AACjB,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,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;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAE/D;;GAEG;AACH,MAAM,UAAU,WAAW;IACzB,OAAO;QACL,0BAA0B;QAC1B,QAAQ;QACR,YAAY;QACZ,aAAa;QACb,aAAa;QACb,YAAY;QACZ,QAAQ;QACR,QAAQ;QACR,YAAY;QACZ,aAAa;QACb,kBAAkB;QAClB,cAAc;QACd,cAAc;QACd,YAAY;QACZ,oBAAoB;QACpB,WAAW;QACX,SAAS;QACT,SAAS;QACT,WAAW;QACX,iBAAiB;QACjB,gBAAgB;QAChB,YAAY;QACZ,gBAAgB;KACjB,CAAC;AACJ,CAAC"}
@@ -45,5 +45,10 @@ export type ErrorEvent = {
45
45
  readonly type: "error";
46
46
  readonly message: string;
47
47
  };
48
- export type StreamEvent = TextDelta | ToolCallStart | ToolCallComplete | ToolCallEnd | PermissionRequest | CostUpdate | TurnComplete | ErrorEvent;
48
+ export type ToolOutputDelta = {
49
+ readonly type: "tool_output_delta";
50
+ readonly callId: string;
51
+ readonly chunk: string;
52
+ };
53
+ export type StreamEvent = TextDelta | ToolCallStart | ToolCallComplete | ToolCallEnd | ToolOutputDelta | PermissionRequest | CostUpdate | TurnComplete | ErrorEvent;
49
54
  //# sourceMappingURL=events.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/types/events.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,MAAM,SAAS,GAAG;IACtB,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,CAAC,IAAI,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user" | "assistant" | "system" | "tool";
5
5
  export type ToolCall = {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Core message types mirrors Claude Code's types/message.ts pattern.
2
+ * Core message types for the agent conversation loop.
3
3
  */
4
4
  export function createMessage(role, content, extra) {
5
5
  return {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Permission types — mirrors Claude Code's ToolPermissionContext.
2
+ * Permission types — tool permission context and risk-based gating.
3
3
  */
4
4
  export type PermissionMode = "ask" | "trust" | "deny";
5
5
  export type RiskLevel = "low" | "medium" | "high";
@@ -12,7 +12,7 @@ export type AskUserFn = (toolName: string, description: string) => Promise<boole
12
12
  /**
13
13
  * Permission gate — decides if a tool call should be allowed.
14
14
  *
15
- * Decision matrix (mirrors Claude Code):
15
+ * Decision matrix:
16
16
  * - LOW risk + read-only: always allow
17
17
  * - trust mode: always allow
18
18
  * - deny mode: only allow LOW read-only
@@ -1,10 +1,10 @@
1
1
  /**
2
- * Permission types — mirrors Claude Code's ToolPermissionContext.
2
+ * Permission types — tool permission context and risk-based gating.
3
3
  */
4
4
  /**
5
5
  * Permission gate — decides if a tool call should be allowed.
6
6
  *
7
- * Decision matrix (mirrors Claude Code):
7
+ * Decision matrix:
8
8
  * - LOW risk + read-only: always allow
9
9
  * - trust mode: always allow
10
10
  * - deny mode: only allow LOW read-only
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Semantic theme system for OpenHarness terminal UI.
3
- * Inspired by Claude Code's 89-color theme with shimmer variants.
3
+ * Semantic color tokens with shimmer variants for animations.
4
4
  */
5
5
  import React from "react";
6
6
  export type Theme = {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Semantic theme system for OpenHarness terminal UI.
3
- * Inspired by Claude Code's 89-color theme with shimmer variants.
3
+ * Semantic color tokens with shimmer variants for animations.
4
4
  */
5
5
  import React from "react";
6
6
  export const darkTheme = {
package/package.json CHANGED
@@ -1,17 +1,23 @@
1
1
  {
2
2
  "name": "@zhijiewang/openharness",
3
- "version": "0.2.0",
4
- "description": "Open-source terminal coding agent. Build your own Claude Code with any LLM.",
3
+ "version": "0.3.0",
4
+ "description": "Open-source terminal coding agent. Works with any LLM.",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "openharness": "./dist/main.js",
8
8
  "oh": "./dist/main.js"
9
9
  },
10
10
  "main": "./dist/main.js",
11
+ "files": [
12
+ "dist",
13
+ "README.md",
14
+ "LICENSE"
15
+ ],
11
16
  "scripts": {
12
17
  "dev": "tsx src/main.tsx",
13
18
  "build": "tsc",
14
19
  "prepare": "tsc",
20
+ "prepublishOnly": "npm run build",
15
21
  "test": "tsx --test src/**/*.test.ts",
16
22
  "typecheck": "tsc --noEmit",
17
23
  "start": "node dist/main.js"
@@ -44,7 +50,7 @@
44
50
  "cli",
45
51
  "coding-agent",
46
52
  "terminal",
47
- "claude-code",
53
+ "coding-assistant",
48
54
  "ollama",
49
55
  "openai",
50
56
  "anthropic"
@@ -1,27 +0,0 @@
1
- ---
2
- name: Bug report
3
- about: Report a bug in OpenHarness
4
- labels: bug
5
- ---
6
-
7
- **Describe the bug**
8
- A clear description of what the bug is.
9
-
10
- **To reproduce**
11
- Steps to reproduce the behavior:
12
- 1. Run `oh ...`
13
- 2. See error
14
-
15
- **Expected behavior**
16
- What you expected to happen.
17
-
18
- **Environment**
19
- - OS:
20
- - Node version:
21
- - OpenHarness version:
22
- - LLM provider:
23
-
24
- **Logs / error output**
25
- ```
26
- paste any relevant output here
27
- ```
@@ -1,17 +0,0 @@
1
- ---
2
- name: Feature request
3
- about: Suggest an idea for OpenHarness
4
- labels: enhancement
5
- ---
6
-
7
- **Problem / motivation**
8
- What problem does this solve, or what use case does it enable?
9
-
10
- **Proposed solution**
11
- Describe the feature you'd like.
12
-
13
- **Alternatives considered**
14
- Any other approaches you've thought about?
15
-
16
- **Additional context**
17
- Screenshots, examples, or links if relevant.
@@ -1,24 +0,0 @@
1
- ## Summary
2
-
3
- <!-- What does this PR do? -->
4
-
5
- ## Related issue
6
-
7
- Closes #
8
-
9
- ## Type of change
10
-
11
- - [ ] Bug fix
12
- - [ ] New feature
13
- - [ ] Breaking change
14
- - [ ] Documentation
15
-
16
- ## Testing
17
-
18
- <!-- How did you test this? -->
19
-
20
- ## Checklist
21
-
22
- - [ ] Code builds without errors (`npm run build`)
23
- - [ ] Types pass (`npm run typecheck`)
24
- - [ ] Tests pass (`npm test`)
@@ -1,31 +0,0 @@
1
- name: CI
2
-
3
- on:
4
- push:
5
- branches: [main]
6
- pull_request:
7
- branches: [main]
8
-
9
- jobs:
10
- build:
11
- runs-on: ubuntu-latest
12
- strategy:
13
- matrix:
14
- node-version: [18, 20, 22]
15
-
16
- steps:
17
- - uses: actions/checkout@v4
18
-
19
- - name: Use Node.js ${{ matrix.node-version }}
20
- uses: actions/setup-node@v4
21
- with:
22
- node-version: ${{ matrix.node-version }}
23
- cache: npm
24
-
25
- - run: npm ci
26
-
27
- - name: Type check
28
- run: npx tsc --noEmit
29
-
30
- - name: Run tests
31
- run: npm test
package/CHANGELOG.md DELETED
@@ -1,18 +0,0 @@
1
- # Changelog
2
-
3
- ## 0.1.0 (2026-04-01)
4
-
5
- Initial alpha release. TypeScript rewrite.
6
-
7
- ### Features
8
- - Single TypeScript process with React+Ink terminal UI
9
- - Agent loop with async generator streaming (mirrors Claude Code's query.ts)
10
- - 5 LLM providers: Ollama, OpenAI, Anthropic, OpenRouter, OpenAI-compatible
11
- - 7 tools: Read, Edit, Write, Bash, Glob, Grep, WebFetch (all with Zod schemas)
12
- - Permission gate with ask/trust/deny modes and risk-based tool approval
13
- - Tool concurrency: read-only parallel, write serial
14
- - Project rules (.oh/RULES.md)
15
- - Cost tracking with per-model breakdown
16
- - Session persistence
17
- - Project auto-detection (15+ languages, 20+ frameworks)
18
- - Global install: `npm install -g openharness` then just `oh`
@@ -1,43 +0,0 @@
1
- # Contributor Covenant Code of Conduct
2
-
3
- ## Our Pledge
4
-
5
- We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.
6
-
7
- We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
-
9
- ## Our Standards
10
-
11
- Examples of behavior that contributes to a positive environment:
12
-
13
- - Demonstrating empathy and kindness toward other people
14
- - Being respectful of differing opinions, viewpoints, and experiences
15
- - Giving and gracefully accepting constructive feedback
16
- - Accepting responsibility and apologizing to those affected by our mistakes
17
- - Focusing on what is best not just for us as individuals, but for the overall community
18
-
19
- Examples of unacceptable behavior:
20
-
21
- - The use of sexualized language or imagery, and sexual attention or advances of any kind
22
- - Trolling, insulting or derogatory comments, and personal or political attacks
23
- - Public or private harassment
24
- - Publishing others' private information without explicit permission
25
- - Other conduct which could reasonably be considered inappropriate in a professional setting
26
-
27
- ## Enforcement Responsibilities
28
-
29
- Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
30
-
31
- ## Scope
32
-
33
- This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces.
34
-
35
- ## Enforcement
36
-
37
- Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at the repository's issue tracker or by contacting the maintainer directly via GitHub.
38
-
39
- All complaints will be reviewed and investigated promptly and fairly.
40
-
41
- ## Attribution
42
-
43
- This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 2.1.
package/CONTRIBUTING.md DELETED
@@ -1,55 +0,0 @@
1
- # Contributing to OpenHarness
2
-
3
- Thanks for your interest in contributing.
4
-
5
- ## Getting Started
6
-
7
- ```bash
8
- git clone https://github.com/zhijiewong/openharness.git
9
- cd openharness
10
- npm install
11
- ```
12
-
13
- ## Development
14
-
15
- ```bash
16
- npx tsx src/main.tsx # run in dev mode
17
- npx tsc --noEmit # type check
18
- npm test # run tests
19
- npm install -g . # install globally to test `oh` command
20
- ```
21
-
22
- ## Making Changes
23
-
24
- 1. Open an issue or discussion before starting large changes.
25
- 2. Create a branch from `main`.
26
- 3. Run `npx tsc --noEmit` and ensure zero errors before submitting a PR.
27
- 4. Keep the README and CLI help text in sync with code changes.
28
-
29
- ## Adding a New Provider
30
-
31
- 1. Create `src/providers/yourprovider.ts` implementing the `Provider` interface from `src/providers/base.ts`.
32
- 2. Implement `stream()`, `complete()`, `listModels()`, and `healthCheck()`.
33
- 3. Add a case in `src/providers/index.ts:createProviderInstance()`.
34
- 4. Add model pricing to `src/harness/cost.ts:MODEL_PRICING`.
35
-
36
- ## Adding a New Tool
37
-
38
- 1. Create `src/tools/YourTool/index.ts` implementing the `Tool` interface from `src/Tool.ts`.
39
- 2. Define a Zod input schema, set `name`, `description`, `riskLevel`.
40
- 3. Implement `call()`, `isReadOnly()`, `isConcurrencySafe()`, `prompt()`.
41
- 4. Register it in `src/tools.ts:getAllTools()`.
42
-
43
- ## Code Style
44
-
45
- - TypeScript strict mode.
46
- - Use Zod for all input validation.
47
- - Async generators for streaming.
48
- - No CLA required.
49
-
50
- ## Reporting Issues
51
-
52
- Open an issue on GitHub with:
53
- - What you expected vs what happened
54
- - Steps to reproduce
55
- - Node.js version and OS
package/SECURITY.md DELETED
@@ -1,21 +0,0 @@
1
- # Security Policy
2
-
3
- ## Supported Versions
4
-
5
- | Version | Supported |
6
- |---------|-----------|
7
- | 0.1.x | ✅ |
8
-
9
- ## Reporting a Vulnerability
10
-
11
- Please **do not** report security vulnerabilities via public GitHub issues.
12
-
13
- Instead, open a [GitHub Security Advisory](https://github.com/zhijiewong/openharness/security/advisories/new) or contact the maintainer directly via the profile on GitHub.
14
-
15
- Please include:
16
- - Description of the vulnerability
17
- - Steps to reproduce
18
- - Potential impact
19
- - Suggested fix (if any)
20
-
21
- You can expect a response within 48 hours. If confirmed, a patch will be prioritized and released as soon as possible.
package/data/models.json DELETED
@@ -1,74 +0,0 @@
1
- {
2
- "gpt-4o": {
3
- "provider": "openai",
4
- "context_window": 128000,
5
- "supports_tools": true,
6
- "supports_vision": true,
7
- "input_cost_per_mtok": 2.50,
8
- "output_cost_per_mtok": 10.00
9
- },
10
- "gpt-4o-mini": {
11
- "provider": "openai",
12
- "context_window": 128000,
13
- "supports_tools": true,
14
- "supports_vision": true,
15
- "input_cost_per_mtok": 0.15,
16
- "output_cost_per_mtok": 0.60
17
- },
18
- "o3-mini": {
19
- "provider": "openai",
20
- "context_window": 200000,
21
- "supports_tools": true,
22
- "supports_vision": false,
23
- "input_cost_per_mtok": 1.10,
24
- "output_cost_per_mtok": 4.40
25
- },
26
- "claude-sonnet-4-6": {
27
- "provider": "anthropic",
28
- "context_window": 200000,
29
- "supports_tools": true,
30
- "supports_vision": true,
31
- "input_cost_per_mtok": 3.00,
32
- "output_cost_per_mtok": 15.00
33
- },
34
- "claude-haiku-4-5": {
35
- "provider": "anthropic",
36
- "context_window": 200000,
37
- "supports_tools": true,
38
- "supports_vision": true,
39
- "input_cost_per_mtok": 0.80,
40
- "output_cost_per_mtok": 4.00
41
- },
42
- "claude-opus-4-6": {
43
- "provider": "anthropic",
44
- "context_window": 200000,
45
- "supports_tools": true,
46
- "supports_vision": true,
47
- "input_cost_per_mtok": 15.00,
48
- "output_cost_per_mtok": 75.00
49
- },
50
- "deepseek-chat": {
51
- "provider": "deepseek",
52
- "context_window": 64000,
53
- "supports_tools": true,
54
- "supports_vision": false,
55
- "input_cost_per_mtok": 0.14,
56
- "output_cost_per_mtok": 0.28
57
- },
58
- "deepseek-coder": {
59
- "provider": "deepseek",
60
- "context_window": 64000,
61
- "supports_tools": true,
62
- "supports_vision": false,
63
- "input_cost_per_mtok": 0.14,
64
- "output_cost_per_mtok": 0.28
65
- },
66
- "qwen-turbo": {
67
- "provider": "qwen",
68
- "context_window": 128000,
69
- "supports_tools": true,
70
- "supports_vision": false,
71
- "input_cost_per_mtok": 0.20,
72
- "output_cost_per_mtok": 0.60
73
- }
74
- }
@@ -1,25 +0,0 @@
1
- You are an AI coding assistant powered by OpenHarness. You help users with software engineering tasks by reading files, editing code, running commands, and managing their codebase.
2
-
3
- # Core Principles
4
-
5
- - Be concise and direct. Lead with the answer or action, not reasoning.
6
- - Read code before suggesting changes. Understand existing patterns.
7
- - Make the smallest change that solves the problem.
8
- - Don't add features, refactoring, or improvements beyond what was asked.
9
- - Don't add error handling for scenarios that can't happen.
10
- - Prioritize writing safe, secure code. Watch for injection, XSS, and OWASP top 10.
11
-
12
- # Tool Usage
13
-
14
- - Use Read to examine files before editing them.
15
- - Use Glob/Grep to find files and code patterns.
16
- - Use Edit for targeted changes (not Write for modifying existing files).
17
- - Use Bash for running tests, git commands, and system operations.
18
- - Ask permission before destructive operations (delete, overwrite, force push).
19
-
20
- # Working Style
21
-
22
- - Break complex tasks into steps.
23
- - Run tests after making changes.
24
- - Use git to track progress on multi-step tasks.
25
- - When stuck, explain what you tried and ask for guidance.
@@ -1,19 +0,0 @@
1
- ---
2
- name: code-review
3
- description: Systematic code review for bugs, security, and quality
4
- whenToUse: When reviewing code changes, PRs, or completed implementations
5
- allowedTools: [Read, Glob, Grep, Bash]
6
- ---
7
-
8
- # Code Review
9
-
10
- Review the code systematically for:
11
-
12
- 1. **Correctness** — Does the code do what it claims? Logic errors?
13
- 2. **Security** — SQL injection, XSS, command injection, path traversal, secrets in code?
14
- 3. **Error handling** — Are errors caught and handled appropriately?
15
- 4. **Edge cases** — Null/empty inputs, boundary conditions, concurrent access?
16
- 5. **Performance** — Unnecessary loops, missing indexes, N+1 queries?
17
- 6. **Readability** — Clear naming, reasonable complexity, adequate (not excessive) comments?
18
-
19
- Report findings with file path, line number, severity (critical/warning/info), and suggested fix.
@@ -1,17 +0,0 @@
1
- ---
2
- name: commit
3
- description: Create well-formed git commits
4
- whenToUse: When the user asks to commit changes or create a PR
5
- allowedTools: [Bash, Read, Glob]
6
- ---
7
-
8
- # Git Commit Workflow
9
-
10
- 1. Run `git status` and `git diff` to see what changed
11
- 2. Run `git log --oneline -5` to match the repo's commit message style
12
- 3. Stage specific files (not `git add -A`) to avoid committing secrets or binaries
13
- 4. Write a concise commit message:
14
- - First line: imperative mood, under 72 chars, describes the "why"
15
- - Body (if needed): explain context, not just what changed
16
- 5. Create the commit
17
- 6. Run `git status` to verify success
@@ -1,24 +0,0 @@
1
- ---
2
- name: debug
3
- description: Systematic debugging approach
4
- whenToUse: When encountering any bug, test failure, or unexpected behavior
5
- allowedTools: [Read, Bash, Grep, Glob]
6
- ---
7
-
8
- # Systematic Debugging
9
-
10
- Follow this process:
11
-
12
- 1. **Reproduce** — Confirm the bug exists. Run the failing test or command.
13
- 2. **Read the error** — What does the error message actually say? Read the full stack trace.
14
- 3. **Locate** — Find the exact line where the error occurs. Read the surrounding code.
15
- 4. **Understand** — Why does this code produce the wrong result? Trace the data flow.
16
- 5. **Hypothesize** — Form a specific theory about the cause.
17
- 6. **Verify** — Test your theory with a minimal change or print statement.
18
- 7. **Fix** — Make the smallest change that fixes the bug.
19
- 8. **Confirm** — Run the test/command again to verify the fix works.
20
-
21
- Rules:
22
- - Don't guess. Read the error message carefully.
23
- - Don't change multiple things at once.
24
- - Don't skip the reproduce step.
@@ -1,22 +0,0 @@
1
- ---
2
- name: tdd
3
- description: Test-driven development workflow
4
- whenToUse: When implementing any feature or bugfix, before writing implementation code
5
- allowedTools: [Read, Edit, Write, Bash, Glob, Grep]
6
- ---
7
-
8
- # Test-Driven Development
9
-
10
- Follow this workflow strictly:
11
-
12
- 1. **Write the test first** — Create a failing test that describes the expected behavior
13
- 2. **Run the test** — Verify it fails for the right reason
14
- 3. **Write minimal implementation** — Only enough code to make the test pass
15
- 4. **Run tests again** — Verify all tests pass
16
- 5. **Refactor** — Clean up the code while keeping tests green
17
-
18
- Rules:
19
- - Never write implementation before the test
20
- - Each test should test one thing
21
- - Keep tests fast and isolated
22
- - Use descriptive test names that explain the behavior
@@ -1,7 +0,0 @@
1
- type Props = {
2
- model?: string;
3
- permissionMode: string;
4
- };
5
- export default function StatusBar({ model, permissionMode }: Props): import("react/jsx-runtime").JSX.Element;
6
- export {};
7
- //# sourceMappingURL=StatusBar.d.ts.map