oh-my-customcode 0.43.0 → 0.43.1

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/dist/cli/index.js CHANGED
@@ -15107,8 +15107,9 @@ async function startServeBackground(projectRoot, port = DEFAULT_PORT) {
15107
15107
  const child = spawn("node", [join9(buildDir, "index.js")], {
15108
15108
  env: {
15109
15109
  ...process.env,
15110
- PORT: String(port),
15111
- HOST: "127.0.0.1",
15110
+ OMCUSTOM_PORT: String(port),
15111
+ OMCUSTOM_HOST: "localhost",
15112
+ OMCUSTOM_ORIGIN: `http://localhost:${port}`,
15112
15113
  OMCUSTOM_PROJECT_ROOT: projectRoot
15113
15114
  },
15114
15115
  stdio: "ignore",
@@ -17025,8 +17026,9 @@ function runForeground(projectRoot, port) {
17025
17026
  spawnSync2("node", [join12(buildDir, "index.js")], {
17026
17027
  env: {
17027
17028
  ...process.env,
17028
- PORT: String(port),
17029
- HOST: "127.0.0.1",
17029
+ OMCUSTOM_PORT: String(port),
17030
+ OMCUSTOM_HOST: "localhost",
17031
+ OMCUSTOM_ORIGIN: `http://localhost:${port}`,
17030
17032
  OMCUSTOM_PROJECT_ROOT: projectRoot
17031
17033
  },
17032
17034
  stdio: "inherit"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "oh-my-customcode",
3
3
  "workspaces": ["packages/*"],
4
- "version": "0.43.0",
4
+ "version": "0.43.1",
5
5
  "description": "Batteries-included agent harness for Claude Code",
6
6
  "type": "module",
7
7
  "bin": {
@@ -115,6 +115,16 @@
115
115
  }
116
116
  ],
117
117
  "description": "Check codex CLI and Agent Teams availability at session start"
118
+ },
119
+ {
120
+ "matcher": "*",
121
+ "hooks": [
122
+ {
123
+ "type": "command",
124
+ "command": "bash .claude/hooks/scripts/serve-autostart.sh"
125
+ }
126
+ ],
127
+ "description": "Auto-start Web UI (packages/serve) in background if not already running"
118
128
  }
119
129
  ],
120
130
  "SubagentStart": [
@@ -0,0 +1,71 @@
1
+ #!/bin/bash
2
+ # Web UI Auto-start Hook
3
+ # Trigger: SessionStart
4
+ # Purpose: Start packages/serve in the background if not already running
5
+ # Protocol: stdin JSON -> stdout pass-through, exit 0 always (never blocks session start)
6
+
7
+ input=$(cat)
8
+
9
+ PID_FILE="$HOME/.omcustom-serve.pid"
10
+
11
+ # Check if already running
12
+ if [ -f "$PID_FILE" ]; then
13
+ EXISTING_PID=$(cat "$PID_FILE" 2>/dev/null || echo "")
14
+ if [ -n "$EXISTING_PID" ] && kill -0 "$EXISTING_PID" 2>/dev/null; then
15
+ # Server already running — silently pass through
16
+ echo "$input"
17
+ exit 0
18
+ else
19
+ # Stale PID file — clean it up
20
+ rm -f "$PID_FILE"
21
+ fi
22
+ fi
23
+
24
+ # Resolve project root: script lives at .claude/hooks/scripts/ -> 3 levels up
25
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
26
+ PROJECT_ROOT="$(cd "${SCRIPT_DIR}/../../.." && pwd)"
27
+
28
+ # Prefer git-based root detection if available
29
+ if command -v git >/dev/null 2>&1; then
30
+ GIT_ROOT=$(git -C "$SCRIPT_DIR" rev-parse --show-toplevel 2>/dev/null || echo "")
31
+ if [ -n "$GIT_ROOT" ]; then
32
+ PROJECT_ROOT="$GIT_ROOT"
33
+ fi
34
+ fi
35
+
36
+ # Locate the build artifact
37
+ BUILD_FILE="${PROJECT_ROOT}/packages/serve/build/index.js"
38
+
39
+ if [ ! -f "$BUILD_FILE" ]; then
40
+ # Build not present — skip silently (advisory only)
41
+ echo "[Hook] Web UI build not found, skipping auto-start (${BUILD_FILE})" >&2
42
+ echo "$input"
43
+ exit 0
44
+ fi
45
+
46
+ # Ensure node is available
47
+ if ! command -v node >/dev/null 2>&1; then
48
+ echo "[Hook] node not found, skipping Web UI auto-start" >&2
49
+ echo "$input"
50
+ exit 0
51
+ fi
52
+
53
+ # Start server fully detached from current process group
54
+ OMCUSTOM_PORT="${OMCUSTOM_PORT:-4321}"
55
+ OMCUSTOM_HOST="${OMCUSTOM_HOST:-localhost}"
56
+ PORT="$OMCUSTOM_PORT"
57
+ HOST="$OMCUSTOM_HOST"
58
+
59
+ nohup env OMCUSTOM_PORT="$OMCUSTOM_PORT" OMCUSTOM_HOST="$OMCUSTOM_HOST" OMCUSTOM_ORIGIN="http://localhost:${PORT}" node "$BUILD_FILE" \
60
+ >"$HOME/.omcustom-serve.log" 2>&1 \
61
+ </dev/null &
62
+ SERVER_PID=$!
63
+ disown "$SERVER_PID"
64
+
65
+ echo "$SERVER_PID" > "$PID_FILE"
66
+
67
+ echo "[Hook] Web UI started (PID ${SERVER_PID}): http://${HOST}:${PORT}" >&2
68
+
69
+ # Pass through stdin JSON
70
+ echo "$input"
71
+ exit 0
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.43.0",
2
+ "version": "0.43.1",
3
3
  "lastUpdated": "2026-03-16T00:00:00.000Z",
4
4
  "components": [
5
5
  {