openhermes 4.0.1 → 4.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 (50) hide show
  1. package/ETHOS.md +6 -3
  2. package/LICENSE +21 -21
  3. package/README.md +111 -81
  4. package/bootstrap.ts +405 -0
  5. package/harness/agents/openhermes.md +45 -55
  6. package/harness/codex/AUTOPILOT.md +126 -0
  7. package/harness/codex/CONSTITUTION.md +14 -11
  8. package/harness/codex/ROUTING.md +35 -69
  9. package/harness/commands/oh-log.md +18 -0
  10. package/harness/instructions/RUNTIME.md +27 -51
  11. package/harness/skills/oh-builder/SKILL.md +27 -16
  12. package/harness/skills/oh-caveman/SKILL.md +9 -0
  13. package/harness/skills/oh-expert/SKILL.md +6 -0
  14. package/harness/skills/oh-facade/SKILL.md +298 -0
  15. package/harness/skills/oh-freeze/SKILL.md +9 -0
  16. package/harness/skills/oh-full-output/SKILL.md +81 -0
  17. package/harness/skills/oh-fusion/SKILL.md +314 -0
  18. package/harness/skills/oh-gauntlet/SKILL.md +10 -6
  19. package/harness/skills/oh-grill/SKILL.md +9 -5
  20. package/harness/skills/oh-guard/SKILL.md +9 -0
  21. package/harness/skills/oh-handoff/SKILL.md +9 -0
  22. package/harness/skills/oh-health/SKILL.md +8 -4
  23. package/harness/skills/oh-init/SKILL.md +80 -13
  24. package/harness/skills/oh-investigate/SKILL.md +57 -8
  25. package/harness/skills/oh-issue/SKILL.md +9 -0
  26. package/harness/skills/oh-learn/SKILL.md +81 -8
  27. package/harness/skills/oh-manifest/SKILL.md +55 -11
  28. package/harness/skills/oh-plan-review/SKILL.md +15 -8
  29. package/harness/skills/oh-planner/SKILL.md +18 -8
  30. package/harness/skills/oh-prd/SKILL.md +9 -0
  31. package/harness/skills/oh-refactor/SKILL.md +426 -0
  32. package/harness/skills/oh-retro/SKILL.md +9 -0
  33. package/harness/skills/oh-review/SKILL.md +12 -5
  34. package/harness/skills/oh-security/SKILL.md +4 -0
  35. package/harness/skills/oh-ship/SKILL.md +10 -0
  36. package/harness/skills/oh-skill-craft/SKILL.md +88 -0
  37. package/harness/skills/oh-skills-link/SKILL.md +9 -0
  38. package/harness/skills/oh-skills-list/SKILL.md +9 -0
  39. package/harness/skills/oh-triage/SKILL.md +11 -0
  40. package/index.ts +3 -0
  41. package/lib/{harness-resolver.mjs → harness-resolver.ts} +16 -12
  42. package/lib/logger.ts +75 -0
  43. package/package.json +16 -10
  44. package/tsconfig.json +16 -0
  45. package/bootstrap.mjs +0 -174
  46. package/harness/instructions/CONVENTIONS.md +0 -206
  47. package/index.mjs +0 -3
  48. package/lib/logger.mjs +0 -62
  49. package/test/plugins-behavioral.test.mjs +0 -64
  50. package/test/plugins.test.mjs +0 -62
@@ -1,64 +0,0 @@
1
- import { describe, it, before } from "node:test"
2
- import assert from "node:assert/strict"
3
- import path from "node:path"
4
- import { fileURLToPath } from "node:url"
5
-
6
- const __dirname = path.dirname(fileURLToPath(import.meta.url))
7
-
8
- describe("BootstrapPlugin behavior", () => {
9
- let mod
10
-
11
- before(async () => {
12
- mod = await import("../bootstrap.mjs")
13
- })
14
-
15
- it("registers package-local skills, commands, agents, and instructions", async () => {
16
- const plugin = await mod.BootstrapPlugin({ directory: __dirname })
17
- const config = { skills: { paths: [] }, command: {}, agent: {}, instructions: [] }
18
-
19
- await plugin.config(config)
20
-
21
- assert.ok(config.skills.paths.some(p => p.endsWith(path.join("harness", "skills"))))
22
- assert.ok(config.command["oh-doctor"])
23
- assert.ok(config.agent.OpenHermes)
24
- assert.equal(config.default_agent, "OpenHermes")
25
- assert.ok(config.instructions.some(p => p.endsWith(path.join("harness", "codex", "CONSTITUTION.md"))))
26
- assert.ok(config.instructions.some(p => p.endsWith(path.join("harness", "instructions", "RUNTIME.md"))))
27
- })
28
-
29
- it("loads markdown manifests into command and agent config", async () => {
30
- const plugin = await mod.BootstrapPlugin({ directory: __dirname })
31
- const config = { skills: { paths: [] }, command: {}, agent: {}, instructions: [] }
32
-
33
- await plugin.config(config)
34
-
35
- assert.match(config.command["oh-doctor"].template, /Inspect the current OpenHermes\/OpenCode setup/)
36
- assert.equal(config.command["oh-doctor"].agent, "OpenHermes")
37
- assert.match(config.agent.OpenHermes.prompt, /You are OpenHermes, the primary orchestrator/)
38
- assert.equal(config.agent.OpenHermes.mode, "primary")
39
- })
40
-
41
- it("injects bootstrap text only once", async () => {
42
- const plugin = await mod.BootstrapPlugin({ directory: __dirname })
43
- const output = {
44
- messages: [
45
- {
46
- info: { role: "user" },
47
- parts: [
48
- { type: "text", text: "actual user request" },
49
- ],
50
- },
51
- ],
52
- }
53
-
54
- await plugin["experimental.chat.messages.transform"]({}, output)
55
- await plugin["experimental.chat.messages.transform"]({}, output)
56
-
57
- assert.match(output.messages[0].parts[0].text, /OPENHERMES_BOOTSTRAP/)
58
- assert.match(output.messages[0].parts[1].text, /actual user request/)
59
- assert.equal(
60
- output.messages[0].parts.filter(part => typeof part.text === "string" && part.text.includes("OPENHERMES_BOOTSTRAP")).length,
61
- 1,
62
- )
63
- })
64
- })
@@ -1,62 +0,0 @@
1
- import { describe, it, before } from "node:test"
2
- import assert from "node:assert/strict"
3
- import fs from "node:fs"
4
- import os from "node:os"
5
- import path from "node:path"
6
-
7
- describe("plugin exports", () => {
8
- it("index.mjs default exports plugin", async () => {
9
- const pkg = await import("../index.mjs")
10
- assert.ok(typeof pkg.default === "function")
11
- })
12
-
13
- it("bootstrap.mjs exports BootstrapPlugin", async () => {
14
- const mod = await import("../bootstrap.mjs")
15
- assert.ok(typeof mod.BootstrapPlugin === "function")
16
- })
17
- })
18
-
19
- describe("bootstrap helpers", () => {
20
- let mod
21
-
22
- before(async () => {
23
- mod = await import("../bootstrap.mjs")
24
- })
25
-
26
- it("re-exports harness resolver helpers", async () => {
27
- const { resolveHarnessRoot, setHarnessRootForTest, getHarnessDir } = mod
28
- assert.ok(typeof resolveHarnessRoot === "function")
29
- assert.ok(typeof setHarnessRootForTest === "function")
30
- assert.ok(typeof getHarnessDir === "function")
31
- })
32
-
33
- it("resolveHarnessRoot picks complete harness root", async () => {
34
- const tmpRoot = fs.mkdtempSync(path.join(os.tmpdir(), "openhermes-harness-"))
35
- const badRoot = path.join(tmpRoot, "bad")
36
- const goodRoot = path.join(tmpRoot, "good")
37
-
38
- fs.mkdirSync(path.join(badRoot, "codex"), { recursive: true })
39
- fs.writeFileSync(path.join(badRoot, "codex", "CONSTITUTION.md"), "# incomplete\n")
40
-
41
- const requiredFiles = [
42
- ["codex", "CONSTITUTION.md"],
43
- ["instructions", "RUNTIME.md"],
44
- ["skills", "oh-plan", "SKILL.md"],
45
- ]
46
-
47
- for (const parts of requiredFiles) {
48
- const filePath = path.join(goodRoot, ...parts)
49
- fs.mkdirSync(path.dirname(filePath), { recursive: true })
50
- fs.writeFileSync(filePath, "ok\n")
51
- }
52
-
53
- const resolved = mod.resolveHarnessRoot({ candidateRoots: [badRoot, goodRoot] })
54
- assert.equal(resolved, goodRoot)
55
- })
56
-
57
- it("setHarnessRootForTest overrides harness resolution", async () => {
58
- mod.setHarnessRootForTest("/custom/harness")
59
- assert.equal(mod.getHarnessDir(), "/custom/harness")
60
- mod.setHarnessRootForTest(undefined)
61
- })
62
- })