oh-my-customcode 0.6.2 → 0.7.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/dist/index.js CHANGED
@@ -1,4 +1,20 @@
1
1
  import { createRequire } from "node:module";
2
+ var __create = Object.create;
3
+ var __getProtoOf = Object.getPrototypeOf;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __toESM = (mod, isNodeMode, target) => {
8
+ target = mod != null ? __create(__getProtoOf(mod)) : {};
9
+ const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
10
+ for (let key of __getOwnPropNames(mod))
11
+ if (!__hasOwnProp.call(to, key))
12
+ __defProp(to, key, {
13
+ get: () => mod[key],
14
+ enumerable: true
15
+ });
16
+ return to;
17
+ };
2
18
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
3
19
 
4
20
  // src/core/config.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oh-my-customcode",
3
- "version": "0.6.2",
3
+ "version": "0.7.0",
4
4
  "description": "Batteries-included agent harness for Claude Code",
5
5
  "type": "module",
6
6
  "bin": {
@@ -46,13 +46,13 @@
46
46
  "yaml": "^2.8.2"
47
47
  },
48
48
  "devDependencies": {
49
- "@anthropic-ai/sdk": "^0.39.0",
49
+ "@anthropic-ai/sdk": "^0.74.0",
50
50
  "@biomejs/biome": "^2.3.12",
51
51
  "@types/bun": "^1.3.6",
52
52
  "@types/js-yaml": "^4.0.9",
53
- "@types/nodemailer": "^6.4.17",
53
+ "@types/nodemailer": "^7.0.9",
54
54
  "js-yaml": "^4.1.0",
55
- "nodemailer": "^6.10.1",
55
+ "nodemailer": "^8.0.1",
56
56
  "typescript": "^5.7.3",
57
57
  "vitepress": "^1.6.3"
58
58
  },
@@ -0,0 +1,115 @@
1
+ ---
2
+ name: monitoring-setup
3
+ description: Enable/disable OpenTelemetry console monitoring for Claude Code usage tracking
4
+ argument-hint: "[enable|disable|status]"
5
+ ---
6
+
7
+ # Monitoring Setup Skill
8
+
9
+ Enable or disable OpenTelemetry console monitoring. When enabled, Claude Code outputs usage metrics (cost, tokens, sessions, LOC, commits, PRs, active time) and events (tool results, API requests) to the terminal.
10
+
11
+ ## Natural Language Triggers
12
+
13
+ This skill activates when the user mentions any of:
14
+ - Korean: "모니터링", "텔레메트리", "사용량 추적", "메트릭", "모니터링 켜줘", "텔레메트리 활성화"
15
+ - English: "monitoring", "telemetry", "usage tracking", "metrics", "enable monitoring"
16
+ - Combined with actions: "켜", "끄", "활성화", "비활성화", "설정", "enable", "disable", "setup"
17
+
18
+ ## Commands
19
+
20
+ ### enable (default)
21
+
22
+ 1. Read `.claude/settings.local.json` (create if not exists)
23
+ 2. Add or update `env` field with:
24
+ ```json
25
+ {
26
+ "env": {
27
+ "CLAUDE_CODE_ENABLE_TELEMETRY": "1",
28
+ "OTEL_METRICS_EXPORTER": "console",
29
+ "OTEL_LOGS_EXPORTER": "console"
30
+ }
31
+ }
32
+ ```
33
+ 3. Preserve all existing settings
34
+ 4. Report to user:
35
+ ```
36
+ [Done] OpenTelemetry Console Monitoring enabled
37
+
38
+ Configured in: .claude/settings.local.json
39
+ Metrics: sessions, cost, tokens, LOC, commits, PRs, active time
40
+ Events: tool results, API requests, tool decisions
41
+
42
+ Note: Takes effect on next `claude` session restart.
43
+ To disable: /monitoring-setup disable
44
+ ```
45
+
46
+ ### disable
47
+
48
+ 1. Read `.claude/settings.local.json`
49
+ 2. Remove OTel-related keys from `env`:
50
+ - `CLAUDE_CODE_ENABLE_TELEMETRY`
51
+ - `OTEL_METRICS_EXPORTER`
52
+ - `OTEL_LOGS_EXPORTER`
53
+ 3. If `env` object becomes empty, remove `env` field entirely
54
+ 4. Report:
55
+ ```
56
+ [Done] OpenTelemetry Monitoring disabled
57
+
58
+ Removed from: .claude/settings.local.json
59
+ Takes effect on next session restart.
60
+ ```
61
+
62
+ ### status
63
+
64
+ 1. Read `.claude/settings.local.json`
65
+ 2. Check for OTel env vars
66
+ 3. Report current state:
67
+ ```
68
+ [Monitoring Status]
69
+ ├── Enabled: Yes/No
70
+ ├── Metrics exporter: console / otlp / none
71
+ ├── Logs exporter: console / otlp / none
72
+ └── Config: .claude/settings.local.json
73
+ ```
74
+
75
+ ## Implementation Notes
76
+
77
+ - `settings.local.json` is NOT git-tracked (local to user)
78
+ - Each user enables monitoring independently
79
+ - No infrastructure required for console mode
80
+ - Metrics appear in stderr during Claude Code execution
81
+ - Default export interval: 60s for metrics, 5s for events
82
+
83
+ ## Available Metrics
84
+
85
+ | Metric | Description | Unit |
86
+ |--------|-------------|------|
87
+ | `claude_code.session.count` | CLI sessions started | count |
88
+ | `claude_code.cost.usage` | Session cost | USD |
89
+ | `claude_code.token.usage` | Tokens used (input/output/cache) | tokens |
90
+ | `claude_code.lines_of_code.count` | Code lines modified (added/removed) | count |
91
+ | `claude_code.commit.count` | Git commits created | count |
92
+ | `claude_code.pull_request.count` | Pull requests created | count |
93
+ | `claude_code.active_time.total` | Active usage time | seconds |
94
+
95
+ ## Available Events
96
+
97
+ | Event | Description |
98
+ |-------|-------------|
99
+ | `claude_code.tool_result` | Tool execution results with duration |
100
+ | `claude_code.api_request` | API request details with cost/tokens |
101
+ | `claude_code.api_error` | API error details |
102
+ | `claude_code.tool_decision` | Tool accept/reject decisions |
103
+ | `claude_code.user_prompt` | User prompt metadata (content redacted by default) |
104
+
105
+ ## Upgrade Path
106
+
107
+ For production monitoring, upgrade from console to OTLP:
108
+
109
+ ```bash
110
+ # In settings.local.json env:
111
+ OTEL_METRICS_EXPORTER=otlp
112
+ OTEL_LOGS_EXPORTER=otlp
113
+ OTEL_EXPORTER_OTLP_PROTOCOL=grpc
114
+ OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317
115
+ ```
@@ -151,6 +151,7 @@ Flow:
151
151
  | `/dev-refactor` | Refactor code |
152
152
  | `/memory-save` | Save session context to claude-mem |
153
153
  | `/memory-recall` | Search and recall memories |
154
+ | `/monitoring-setup` | Enable/disable OTel console monitoring |
154
155
  | `/npm-publish` | Publish package to npm registry |
155
156
  | `/npm-version` | Manage semantic versions |
156
157
  | `/npm-audit` | Audit dependencies |
@@ -151,6 +151,7 @@ oh-my-customcode로 구동됩니다.
151
151
  | `/dev-refactor` | 코드 리팩토링 |
152
152
  | `/memory-save` | 세션 컨텍스트를 claude-mem에 저장 |
153
153
  | `/memory-recall` | 메모리 검색 및 리콜 |
154
+ | `/monitoring-setup` | OTel 콘솔 모니터링 활성화/비활성화 |
154
155
  | `/npm-publish` | npm 레지스트리에 패키지 배포 |
155
156
  | `/npm-version` | 시맨틱 버전 관리 |
156
157
  | `/npm-audit` | 의존성 감사 |