openhermes 4.1.0 → 4.9.2
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/CONTEXT.md +9 -0
- package/ETHOS.md +6 -3
- package/LICENSE +21 -21
- package/README.md +120 -79
- package/bootstrap.ts +284 -41
- package/harness/agents/oh-browser.md +97 -0
- package/harness/agents/oh-builder.md +78 -0
- package/harness/agents/oh-facade.md +75 -0
- package/harness/agents/oh-fusion.md +45 -0
- package/harness/agents/oh-gauntlet.md +71 -0
- package/harness/agents/oh-grill.md +71 -0
- package/harness/agents/oh-investigate.md +60 -0
- package/harness/agents/oh-manifest.md +95 -0
- package/harness/agents/oh-plan-review.md +40 -0
- package/harness/agents/oh-planner.md +50 -0
- package/harness/agents/oh-refactor.md +37 -0
- package/harness/agents/oh-retro.md +46 -0
- package/harness/agents/oh-review.md +85 -0
- package/harness/agents/oh-security.md +83 -0
- package/harness/agents/oh-ship.md +76 -0
- package/harness/agents/oh-skill-craft.md +38 -0
- package/harness/agents/openhermes.md +106 -62
- package/harness/codex/AUTOPILOT.md +178 -0
- package/harness/codex/CHARTER.md +81 -0
- package/harness/commands/oh-doctor.md +193 -14
- package/harness/commands/oh-log.md +18 -0
- package/harness/instructions/SHELL.md +76 -0
- package/harness/skills/oh-ascii/DEEP.md +292 -0
- package/harness/skills/oh-ascii/SKILL.md +31 -0
- package/harness/skills/oh-ascii/scripts/check_ascii_alignment.py +596 -0
- package/harness/skills/oh-browser/DEEP.md +54 -0
- package/harness/skills/oh-browser/SKILL.md +30 -0
- package/harness/skills/oh-builder/DEEP.md +63 -0
- package/harness/skills/oh-builder/SKILL.md +16 -89
- package/harness/skills/oh-expert/DEEP.md +85 -0
- package/harness/skills/oh-expert/SKILL.md +19 -106
- package/harness/skills/oh-facade/DEEP.md +182 -0
- package/harness/skills/oh-facade/SKILL.md +34 -0
- package/harness/skills/oh-freeze/DEEP.md +18 -0
- package/harness/skills/oh-freeze/SKILL.md +15 -15
- package/harness/skills/oh-full-output/DEEP.md +25 -0
- package/harness/skills/oh-full-output/SKILL.md +28 -0
- package/harness/skills/oh-fusion/DEEP.md +120 -0
- package/harness/skills/oh-fusion/SKILL.md +36 -0
- package/harness/skills/oh-gauntlet/DEEP.md +77 -0
- package/harness/skills/oh-gauntlet/SKILL.md +17 -105
- package/harness/skills/oh-grill/DEEP.md +51 -0
- package/harness/skills/oh-grill/SKILL.md +16 -63
- package/harness/skills/oh-guard/DEEP.md +19 -0
- package/harness/skills/oh-guard/SKILL.md +15 -20
- package/harness/skills/oh-handoff/DEEP.md +48 -0
- package/harness/skills/oh-handoff/SKILL.md +18 -19
- package/harness/skills/oh-health/DEEP.md +74 -0
- package/harness/skills/oh-health/SKILL.md +17 -76
- package/harness/skills/oh-init/DEEP.md +85 -0
- package/harness/skills/oh-init/SKILL.md +17 -197
- package/harness/skills/oh-investigate/DEEP.md +171 -0
- package/harness/skills/oh-investigate/SKILL.md +18 -61
- package/harness/skills/oh-issue/DEEP.md +21 -0
- package/harness/skills/oh-issue/SKILL.md +16 -23
- package/harness/skills/oh-learn/DEEP.md +44 -0
- package/harness/skills/oh-learn/SKILL.md +17 -79
- package/harness/skills/oh-manifest/DEEP.md +92 -0
- package/harness/skills/oh-manifest/SKILL.md +15 -107
- package/harness/skills/oh-plan-review/DEEP.md +90 -0
- package/harness/skills/oh-plan-review/SKILL.md +19 -114
- package/harness/skills/oh-planner/DEEP.md +172 -0
- package/harness/skills/oh-planner/SKILL.md +16 -143
- package/harness/skills/oh-prd/DEEP.md +45 -0
- package/harness/skills/oh-prd/SKILL.md +15 -22
- package/harness/skills/oh-refactor/DEEP.md +122 -0
- package/harness/skills/oh-refactor/SKILL.md +33 -0
- package/harness/skills/oh-retro/DEEP.md +26 -0
- package/harness/skills/oh-retro/SKILL.md +17 -20
- package/harness/skills/oh-review/DEEP.md +87 -0
- package/harness/skills/oh-review/SKILL.md +17 -96
- package/harness/skills/oh-security/DEEP.md +83 -0
- package/harness/skills/oh-security/SKILL.md +18 -96
- package/harness/skills/oh-ship/DEEP.md +141 -0
- package/harness/skills/oh-ship/SKILL.md +18 -26
- package/harness/skills/oh-skill-craft/DEEP.md +369 -0
- package/harness/skills/oh-skill-craft/SKILL.md +20 -93
- package/harness/skills/oh-skills-link/DEEP.md +16 -0
- package/harness/skills/oh-skills-link/SKILL.md +15 -16
- package/harness/skills/oh-skills-list/DEEP.md +20 -0
- package/harness/skills/oh-skills-list/SKILL.md +14 -18
- package/harness/skills/oh-triage/DEEP.md +23 -0
- package/harness/skills/oh-triage/SKILL.md +15 -20
- package/harness/skills/oh-worktree/DEEP.md +169 -0
- package/harness/skills/oh-worktree/SKILL.md +32 -0
- package/lib/harness-resolver.ts +10 -12
- package/package.json +9 -4
- package/scripts/count-tokens.mjs +158 -0
- package/scripts/oh-doctor.ps1 +342 -0
- package/harness/codex/CONSTITUTION.md +0 -70
- package/harness/codex/ROUTING.md +0 -127
- package/harness/instructions/RUNTIME.md +0 -55
- package/harness/skills/oh-caveman/SKILL.md +0 -33
- package/lib/logger.ts +0 -69
package/lib/logger.ts
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import path from "node:path"
|
|
2
|
-
import os from "node:os"
|
|
3
|
-
import fs from "node:fs"
|
|
4
|
-
|
|
5
|
-
export interface Logger {
|
|
6
|
-
debug: (...args: unknown[]) => void
|
|
7
|
-
info: (...args: unknown[]) => void
|
|
8
|
-
warn: (...args: unknown[]) => void
|
|
9
|
-
error: (...args: unknown[]) => void
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
const LEVELS: Record<string, number> = { debug: 0, info: 1, warn: 2, error: 3 }
|
|
13
|
-
const CURRENT_LEVEL = LEVELS[process.env.OPENCODE_LOG_LEVEL?.trim().toLowerCase()] ?? (process.env.OPENHERMES_LOG_LEVEL?.trim().toLowerCase() === "debug" ? LEVELS.debug : LEVELS.warn)
|
|
14
|
-
|
|
15
|
-
const LOG_DIR = path.join(os.homedir(), ".local", "share", "opencode", "log")
|
|
16
|
-
const LOG_FILE = path.join(LOG_DIR, "openhermes.log")
|
|
17
|
-
|
|
18
|
-
function ts(): string {
|
|
19
|
-
const d = new Date()
|
|
20
|
-
return `${d.getFullYear()}-${(d.getMonth()+1).toString().padStart(2,"0")}-${d.getDate().toString().padStart(2,"0")} ${d.getHours().toString().padStart(2,"0")}:${d.getMinutes().toString().padStart(2,"0")}:${d.getSeconds().toString().padStart(2,"0")}.${d.getMilliseconds().toString().padStart(3,"0")}`
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function formatArgs(args: unknown[]): string {
|
|
24
|
-
return args.map(a => {
|
|
25
|
-
if (a === null) return "null"
|
|
26
|
-
if (a === undefined) return "undefined"
|
|
27
|
-
if (typeof a === "object") {
|
|
28
|
-
try { return (a as Error)?.message || JSON.stringify(a) } catch { return String(a) }
|
|
29
|
-
}
|
|
30
|
-
return String(a)
|
|
31
|
-
}).join(" ")
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
function shouldLog(levelName: string): boolean {
|
|
35
|
-
return LEVELS[levelName] >= CURRENT_LEVEL
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
let _fd: number | null = null
|
|
39
|
-
function getFd(): number {
|
|
40
|
-
if (_fd) return _fd
|
|
41
|
-
try {
|
|
42
|
-
fs.mkdirSync(LOG_DIR, { recursive: true })
|
|
43
|
-
_fd = fs.openSync(LOG_FILE, "a")
|
|
44
|
-
} catch {
|
|
45
|
-
_fd = -1
|
|
46
|
-
}
|
|
47
|
-
return _fd
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export function createLogger(name: string): Logger {
|
|
51
|
-
const prefix = `[openhermes:${name}]`
|
|
52
|
-
|
|
53
|
-
function emit(levelName: string, ...args: unknown[]): void {
|
|
54
|
-
if (!shouldLog(levelName)) return
|
|
55
|
-
const fd = getFd()
|
|
56
|
-
if (fd < 0) return
|
|
57
|
-
const line = `${ts()} ${prefix} [${levelName.toUpperCase()}] ${formatArgs(args)}\n`
|
|
58
|
-
try { fs.writeSync(fd, line) } catch {}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
return {
|
|
62
|
-
debug: (...args: unknown[]) => emit("debug", ...args),
|
|
63
|
-
info: (...args: unknown[]) => emit("info", ...args),
|
|
64
|
-
warn: (...args: unknown[]) => emit("warn", ...args),
|
|
65
|
-
error: (...args: unknown[]) => emit("error", ...args),
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export const rootLogger: Logger = createLogger("root")
|