@pinta-ai/pinta-codex 1.2.0 → 1.2.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/README.md CHANGED
@@ -2,18 +2,18 @@
2
2
 
3
3
  Generic OTLP forwarder for Codex hook events.
4
4
 
5
- > **엔드유저 설치 가이드:** [`docs/installation-guide.md`](./docs/installation-guide.md)
6
- > **pinta-cc와의 차이:** [`docs/codex-vs-claude-code.md`](./docs/codex-vs-claude-code.md)
7
- > 이 README는 개발자 관점 개요입니다.
5
+ > **End-user install guide:** [`docs/installation-guide.md`](./docs/installation-guide.md)
6
+ > **Differences from pinta-cc:** [`docs/codex-vs-claude-code.md`](./docs/codex-vs-claude-code.md)
7
+ > This README is a developer-oriented overview.
8
8
 
9
9
  ## Channels
10
10
 
11
- 두 채널이 병행 운영됩니다. `~/.codex/hooks.json` 의 absolute-path prefix 로 구분되어 같은 머신에서 공존 가능합니다.
11
+ Two channels are operated in parallel. They coexist on the same machine because each entry in `~/.codex/hooks.json` is discriminated by its absolute-path prefix.
12
12
 
13
- | Channel | 사용자 | 설치 |
14
- |---------|-------|------|
15
- | **Pinta Manager** (v0.2+) | Pinta 사용자 | catalog 가 npm tarball install → manager root prefix 로 hooks.json entry 자동 등록. **manual setup 불필요.** |
16
- | **Git clone + npm run setup** | OSS / standalone | 아래 Quick start 참조. `~/.codex/pinta-codex.env` 에 직접 endpoint/token 작성. |
13
+ | Channel | Audience | Install |
14
+ |---------|----------|---------|
15
+ | **Pinta Manager** (v0.2+) | Pinta users | The catalog installs the npm tarball and registers a `hooks.json` entry under the manager root prefix automatically. **No manual setup required.** |
16
+ | **Git clone + npm run setup** | OSS / standalone | See Quick start below. Endpoint/token are written directly to `~/.codex/pinta-codex.env`. |
17
17
 
18
18
  ## Quick start (OSS / standalone)
19
19
 
@@ -26,11 +26,11 @@ codex # hooks fire immediately
26
26
  npm run doctor # verify everything green
27
27
  ```
28
28
 
29
- `setup`은 idempotent — 재실행해도 안전합니다. `doctor`는 read-only.
29
+ `setup` is idempotent — re-running it is safe. `doctor` is read-only.
30
30
 
31
31
  ## What it captures
32
32
 
33
- Codex의 hook 시스템 (실험적; `~/.codex/config.toml`의 `features.codex_hooks = true` 활성화 필요) 이 현재 발화하는 5개 이벤트가 모두 핸들링됩니다.
33
+ All five events that Codex's hook system (experimental; requires `features.codex_hooks = true` in `~/.codex/config.toml`) currently emits are handled.
34
34
 
35
35
  | Event | Notes |
36
36
  |-------|-------|
@@ -40,19 +40,19 @@ Codex의 hook 시스템 (실험적; `~/.codex/config.toml`의 `features.codex_ho
40
40
  | `PostToolUse` | **Bash tool only** (current Codex limitation) |
41
41
  | `Stop` | final flush |
42
42
 
43
- 각 invocation은 `node dist/index.js`를 spawn하고, 이벤트를 OTLP span 하나로 매핑한 뒤 `{endpoint}/traces`로 POST합니다.
43
+ Each invocation spawns `node dist/index.js`, maps the event to a single OTLP span, and POSTs it to `{endpoint}/traces`.
44
44
 
45
45
  ## Behavior
46
46
 
47
- - OTLP/HTTP JSON transport. 헤더는 `OTEL_EXPORTER_OTLP_HEADERS` 에서 읽음 (`key=val,key=val` 형식)
48
- - Top-level 이벤트 필드는 `codex.*` span attribute 로 평탄화 (Bronze; 형제 adaptor는 `cc.*`, `mcp.*`)
49
- - **No fail-close** — 모든 hook은 성공 시 exit 0 (전송 실패는 retry queue 로 흡수)
50
- - Disk-backed retry queue at `.plugin-data/failed-spans.jsonl` (cap 1000). 다음 hook 호출 시 일괄 drain
51
- - One trace per user turn — `UserPromptSubmit` ULID 기반
47
+ - OTLP/HTTP JSON transport. Headers are read from `OTEL_EXPORTER_OTLP_HEADERS` (`key=val,key=val` format)
48
+ - Top-level event fields are flattened into `codex.*` span attributes (Bronze; sibling adaptors use `cc.*`, `mcp.*`)
49
+ - **No fail-close** — every hook exits 0 on success (transmission failures are absorbed by the retry queue)
50
+ - Disk-backed retry queue at `.plugin-data/failed-spans.jsonl` (cap 1000). Drained on the next hook invocation
51
+ - One trace per user turn — based on the `UserPromptSubmit` ULID
52
52
 
53
53
  ## Configuration
54
54
 
55
- `npm run setup` 이 `~/.codex/pinta-codex.env` 에 endpoint + 헤더를 씁니다. 환경변수로 파일 값을 덮어쓸 수 있습니다.
55
+ `npm run setup` writes the endpoint and headers to `~/.codex/pinta-codex.env`. Environment variables override file values.
56
56
 
57
57
  ```bash
58
58
  # OTel-spec (primary)
@@ -63,7 +63,7 @@ export OTEL_EXPORTER_OTLP_HEADERS="x-pinta-relay-token=YOUR-TOKEN"
63
63
  export OTEL_EXPORTER_OTLP_HEADERS="Authorization=Bearer YOUR-TOKEN"
64
64
  ```
65
65
 
66
- `~/.codex/pinta-codex.env` 예시:
66
+ Example `~/.codex/pinta-codex.env`:
67
67
 
68
68
  ```env
69
69
  OTEL_EXPORTER_OTLP_ENDPOINT=https://your-collector.example.com
@@ -86,11 +86,11 @@ export CODEX_HOME="/abs/path/to/.codex" # override ~/.codex dur
86
86
 
87
87
  ## Identity — not needed
88
88
 
89
- v1.2부터 Pinta CLI 의존이 제거되었습니다. Identity 부착은 relay 계층 책임입니다. Pinta Manager 가 forward 시 첨부하며, OSS 사용자는 자기 pipeline 에서 처리합니다. 플러그인 자체는 identity 없이 동작하며, 어떤 hook 도 identity 부재로 차단되지 않습니다.
89
+ Since v1.2 the Pinta CLI dependency has been removed. Identity attachment is the responsibility of the relay layer. Pinta Manager attaches it on forward, and OSS users handle it in their own pipeline. The plugin itself runs without identity, and no hook is blocked by its absence.
90
90
 
91
91
  ## Manual install (advanced)
92
92
 
93
- interactive setup 을 쓰지 않으려면:
93
+ If you don't want to use the interactive setup:
94
94
 
95
95
  ```bash
96
96
  npm run build
@@ -98,16 +98,16 @@ npm run install-hooks # merges absolute paths into ~/.codex/hoo
98
98
  npm run install-hooks -- --dry-run # preview without writing
99
99
  ```
100
100
 
101
- `install-hooks` 는 idempotent: `~/.codex/hooks.json` 이 번들 템플릿과 이미 일치하면 `already up to date` 로 no-op. 이전 경로의 stale pinta-codex 엔트리는 자동 감지·제거 (`removed N stale pinta-codex entries`).
101
+ `install-hooks` is idempotent: if `~/.codex/hooks.json` already matches the bundled template, it's a no-op (`already up to date`). Stale pinta-codex entries from previous paths are detected and removed automatically (`removed N stale pinta-codex entries`).
102
102
 
103
- `~/.codex/config.toml` 에 수동으로 추가:
103
+ Add the following manually to `~/.codex/config.toml`:
104
104
 
105
105
  ```toml
106
106
  [features]
107
107
  codex_hooks = true
108
108
  ```
109
109
 
110
- > **Why an install script?** Codex는 아직 `.codex-plugin/plugin.json` 에서 hook 을 자동 로드하지 않습니다. `install-hooks` 가 번들 `hooks.json` 템플릿의 `${CODEX_PLUGIN_ROOT}` 를 절대경로로 교체하고 user-level 파일에 merge 합니다. Codex 가 plugin-hook auto-discovery 를 추가하면 이 단계는 사라집니다.
110
+ > **Why an install script?** Codex does not yet auto-load hooks from `.codex-plugin/plugin.json`. `install-hooks` substitutes `${CODEX_PLUGIN_ROOT}` in the bundled `hooks.json` template with an absolute path and merges it into the user-level file. Once Codex adds plugin-hook auto-discovery, this step will go away.
111
111
 
112
112
  ## Uninstall
113
113
 
@@ -115,13 +115,13 @@ codex_hooks = true
115
115
  npm run uninstall-hooks
116
116
  ```
117
117
 
118
- `dist/index.js` 를 참조하는 이 플러그인의 `~/.codex/hooks.json` 엔트리만 제거합니다. 다른 hook 은 건드리지 않습니다.
118
+ This removes only this plugin's entries from `~/.codex/hooks.json` (those referencing `dist/index.js`). Other hooks are left untouched.
119
119
 
120
- 완전 제거:
120
+ For a complete removal:
121
121
 
122
122
  ```bash
123
123
  rm ~/.codex/pinta-codex.env
124
- # ~/.codex/config.toml 에서 [features] codex_hooks = true 라인 수동 삭제
124
+ # Manually remove the [features] codex_hooks = true line from ~/.codex/config.toml
125
125
  ```
126
126
 
127
127
  ## Local development
@@ -132,13 +132,13 @@ Mock server (OTLP viewer at `http://localhost:3000`):
132
132
  npm run mock-server
133
133
  ```
134
134
 
135
- 다른 터미널에서 endpoint 를 mock 으로 설정하고 Codex 시작:
135
+ In another terminal, point the endpoint at the mock and start Codex:
136
136
 
137
137
  ```bash
138
138
  OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:3000 codex
139
139
  ```
140
140
 
141
- 또는 stdin pipe 로 setup:
141
+ Or set up via stdin pipe:
142
142
 
143
143
  ```bash
144
144
  printf 'http://localhost:3000\n\n' | npm run setup
@@ -161,21 +161,21 @@ printf 'http://localhost:3000\n\n' | npm run setup
161
161
 
162
162
  ## BREAKING CHANGES from 1.0.x / 1.1.x
163
163
 
164
- 상세한 마이그레이션 안내는 [`CHANGELOG.md`](./CHANGELOG.md) 를 참조하세요.
164
+ See [`CHANGELOG.md`](./CHANGELOG.md) for the full migration guide.
165
165
 
166
- 요약:
167
- - Pinta CLI 의존 제거. `pinta login` 불필요
168
- - `PINTA_CODEX_ENDPOINT` / `PINTA_CODEX_API_KEY` → `OTEL_EXPORTER_OTLP_ENDPOINT` / `OTEL_EXPORTER_OTLP_HEADERS` (legacy 키는 backward-compat 으로 인식되며 다음 `npm run setup` 시 자동 마이그레이션)
169
- - PreToolUse fail-close 제거. 모든 hook 은 exit 0 on success
170
- - `member.identity.*` resource attribute 제거
166
+ Summary:
167
+ - Pinta CLI dependency removed. `pinta login` no longer required
168
+ - `PINTA_CODEX_ENDPOINT` / `PINTA_CODEX_API_KEY` → `OTEL_EXPORTER_OTLP_ENDPOINT` / `OTEL_EXPORTER_OTLP_HEADERS` (legacy keys are still recognized for backward compatibility and auto-migrated on the next `npm run setup`)
169
+ - PreToolUse fail-close removed. Every hook exits 0 on success
170
+ - `member.identity.*` resource attributes removed
171
171
 
172
- ### 마이그레이션 액션
172
+ ### Migration actions
173
173
 
174
- | 채널 | 액션 |
175
- |------|------|
176
- | **Pinta Manager v0.2+** | 자동. 다음 reconcile 에 기존 hook entry 가 manager-installed 1.2.0 entry 로 교체되고 `~/.codex/pinta-codex.env` 의 PINTA_* 키는 OTEL_* 로 갱신. |
177
- | **Git clone (기존 사용자)** | `git pull && npm run setup` 1회 재실행. setup 이 legacy `PINTA_CODEX_*` 키를 OTel 키로 자동 마이그레이션 (.bak 백업). |
178
- | **재setup 안 함** | hook 자체는 1.0.x/1.1.x 코드 그대로라면 동작 유지. 단 dist/ 가 1.2.0 으로 빌드된 상태에서 PINTA_CODEX_* 만 남아있으면 backward-compat path 로 동작 (재setup 권장). |
174
+ | Channel | Action |
175
+ |---------|--------|
176
+ | **Pinta Manager v0.2+** | Automatic. On the next reconcile, the existing hook entry is replaced with the manager-installed 1.2.0 entry, and `PINTA_*` keys in `~/.codex/pinta-codex.env` are renamed to `OTEL_*`. |
177
+ | **Git clone (existing users)** | Run `git pull && npm run setup` once. Setup auto-migrates legacy `PINTA_CODEX_*` keys to OTel keys (with a `.bak` backup). |
178
+ | **No re-setup** | If the hooks themselves are still 1.0.x/1.1.x code, they keep working. If `dist/` has been built at 1.2.0 but only `PINTA_CODEX_*` keys remain, the backward-compat path kicks in (re-setup recommended). |
179
179
 
180
180
  ## Repo layout
181
181
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pinta-ai/pinta-codex",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "Generic OTLP forwarder for Codex hook events",
5
5
  "main": "dist/index.js",
6
6
  "license": "SEE LICENSE IN ./LICENSE",