claudecode-omc 5.0.0 → 5.1.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/.local/hud/omc-hud.mjs +98 -0
- package/bundled/manifest.json +1 -1
- package/package.json +2 -1
- package/src/config/paths.js +6 -1
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* OMC HUD - Standalone Statusline Script
|
|
4
|
+
* Self-contained version for claudecode-omc (no upstream dist/hud dependency)
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { readFileSync, existsSync, readdirSync, statSync } from "node:fs";
|
|
8
|
+
import { homedir } from "node:os";
|
|
9
|
+
import { join } from "node:path";
|
|
10
|
+
|
|
11
|
+
function main() {
|
|
12
|
+
const home = homedir();
|
|
13
|
+
const configDir = process.env.CLAUDE_CONFIG_DIR || join(home, ".claude");
|
|
14
|
+
|
|
15
|
+
const parts = [];
|
|
16
|
+
|
|
17
|
+
// 1. Package version
|
|
18
|
+
const version = getPackageVersion();
|
|
19
|
+
if (version) parts.push(`omc v${version}`);
|
|
20
|
+
|
|
21
|
+
// 2. Skills count
|
|
22
|
+
const skillsDir = join(configDir, "skills");
|
|
23
|
+
const skillCount = countDirs(skillsDir);
|
|
24
|
+
if (skillCount > 0) parts.push(`${skillCount} skills`);
|
|
25
|
+
|
|
26
|
+
// 3. Agents count
|
|
27
|
+
const agentsDir = join(configDir, "agents");
|
|
28
|
+
const agentCount = countFiles(agentsDir, ".md");
|
|
29
|
+
if (agentCount > 0) parts.push(`${agentCount} agents`);
|
|
30
|
+
|
|
31
|
+
// 4. Active OMC state
|
|
32
|
+
const omcState = readOmcState();
|
|
33
|
+
if (omcState) parts.push(omcState);
|
|
34
|
+
|
|
35
|
+
// 5. Git branch
|
|
36
|
+
const branch = getGitBranch();
|
|
37
|
+
if (branch) parts.push(branch);
|
|
38
|
+
|
|
39
|
+
console.log(parts.join(" | ") || "omc ready");
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function getPackageVersion() {
|
|
43
|
+
try {
|
|
44
|
+
// Check global npm install
|
|
45
|
+
const result = JSON.parse(readFileSync(
|
|
46
|
+
new URL("claudecode-omc/package.json", import.meta.resolve("claudecode-omc")),
|
|
47
|
+
"utf8"
|
|
48
|
+
));
|
|
49
|
+
return result.version;
|
|
50
|
+
} catch {
|
|
51
|
+
// Fallback: check common locations
|
|
52
|
+
const candidates = [
|
|
53
|
+
join(homedir(), ".omc-manage", "package-version"),
|
|
54
|
+
];
|
|
55
|
+
for (const p of candidates) {
|
|
56
|
+
try {
|
|
57
|
+
return readFileSync(p, "utf8").trim();
|
|
58
|
+
} catch { /* continue */ }
|
|
59
|
+
}
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function countDirs(dir) {
|
|
65
|
+
try {
|
|
66
|
+
return readdirSync(dir, { withFileTypes: true })
|
|
67
|
+
.filter(e => e.isDirectory()).length;
|
|
68
|
+
} catch { return 0; }
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function countFiles(dir, ext) {
|
|
72
|
+
try {
|
|
73
|
+
return readdirSync(dir)
|
|
74
|
+
.filter(f => f.endsWith(ext)).length;
|
|
75
|
+
} catch { return 0; }
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function readOmcState() {
|
|
79
|
+
const stateFile = join(process.cwd(), ".omc", "state", "active-mode.json");
|
|
80
|
+
try {
|
|
81
|
+
const state = JSON.parse(readFileSync(stateFile, "utf8"));
|
|
82
|
+
if (state.mode) return state.mode;
|
|
83
|
+
} catch { /* no active mode */ }
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function getGitBranch() {
|
|
88
|
+
const headFile = join(process.cwd(), ".git", "HEAD");
|
|
89
|
+
try {
|
|
90
|
+
const head = readFileSync(headFile, "utf8").trim();
|
|
91
|
+
if (head.startsWith("ref: refs/heads/")) {
|
|
92
|
+
return head.slice("ref: refs/heads/".length);
|
|
93
|
+
}
|
|
94
|
+
return head.slice(0, 7); // detached HEAD
|
|
95
|
+
} catch { return null; }
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
main();
|
package/bundled/manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claudecode-omc",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.1.0",
|
|
4
4
|
"description": "Claude Code harness — best-practice skills, agents, hooks, and configs from multiple sources",
|
|
5
5
|
"bin": {
|
|
6
6
|
"omc-manage": "bin/omc-manage.js"
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
"files": [
|
|
9
9
|
"bin",
|
|
10
10
|
"src",
|
|
11
|
+
".local",
|
|
11
12
|
"bundled",
|
|
12
13
|
"scripts",
|
|
13
14
|
"templates",
|
package/src/config/paths.js
CHANGED
|
@@ -36,7 +36,12 @@ function getSourceArtifactDir(sourceName, artifactType, root) {
|
|
|
36
36
|
|
|
37
37
|
if (isDistributionMode()) {
|
|
38
38
|
if (sourceName === 'local') {
|
|
39
|
-
|
|
39
|
+
// Check user-customized local first, then fall back to bundled .local/
|
|
40
|
+
const userLocal = path.join(USER_DATA_DIR, 'local', artifactType);
|
|
41
|
+
if (fs.existsSync(userLocal)) {
|
|
42
|
+
return userLocal;
|
|
43
|
+
}
|
|
44
|
+
return path.join(root, '.local', artifactType);
|
|
40
45
|
}
|
|
41
46
|
// Check user-synced first, then fall back to bundled
|
|
42
47
|
const synced = path.join(USER_DATA_DIR, 'upstream', sourceName, artifactType);
|