@uzysjung/agent-harness 26.136.0 → 26.137.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.
@@ -14,7 +14,7 @@ import {
14
14
  init_esm_shims,
15
15
  residentCost,
16
16
  resolveBundleRoot
17
- } from "./chunk-WCH7E3G6.js";
17
+ } from "./chunk-MIENWYJR.js";
18
18
 
19
19
  // src/trust-tier-drift.ts
20
20
  init_esm_shims();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uzysjung/agent-harness",
3
- "version": "26.136.0",
3
+ "version": "26.137.0",
4
4
  "description": "Curate vetted AI-coding skills & plugins by your tech stack — install only what you need, across Claude Code, Codex, OpenCode & Antigravity",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -7,7 +7,8 @@ BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo "")
7
7
 
8
8
  # 1. git pull (branch가 있고 detached HEAD가 아닐 때)
9
9
  if [ -n "$BRANCH" ] && [ "$BRANCH" != "HEAD" ]; then
10
- git pull --rebase 2>/dev/null || true
10
+ # stdout 버린다 여기 출력이 아래 JSON 앞에 붙으면 계약이 깨진다 (실측 21%).
11
+ git pull --rebase >/dev/null 2>&1 || true
11
12
  fi
12
13
 
13
14
  # 2. SPEC 존재 여부 확인
@@ -47,15 +48,27 @@ if [ "${ORPHANS:-0}" -gt 0 ]; then
47
48
  fi
48
49
 
49
50
  # 5. 세션 컨텍스트 출력
51
+ #
52
+ # **스키마가 계약이다.** CLI 가 읽는 필드가 아니면 **유효 JSON 인 채로 조용히 버려진다** —
53
+ # 훅은 돌고 exit 0 이고 로그에도 남지만 모델은 아무것도 못 본다. 실패가 아무 증상을 안 내므로
54
+ # 사람이 알아채지 못한다. SessionStart 가 읽는 것은
55
+ # `hookSpecificOutput.{additionalContext|initialUserMessage}` 다.
56
+ # 조용히 버려지는 출력은 컨텍스트 비용이 0 인 대신 기능도 0 이다.
50
57
  if [ "$SPEC_EXISTS" = "true" ]; then
51
58
  MSG="Session started. Branch: ${BRANCH:-detached}. SPEC exists — read docs/SPEC.md first (Persistent Anchor). Check Change Log and current Phase before starting work.${COMPACT_WARNING}${ORPHAN_NOTE}"
52
59
  else
53
60
  MSG="Session started. Branch: ${BRANCH:-detached}. No SPEC found.${COMPACT_WARNING}${ORPHAN_NOTE}"
54
61
  fi
55
62
 
63
+ # JSON 문자열 이스케이프 — 백슬래시 먼저, 그 다음 따옴표(순서를 바꾸면 이중 이스케이프된다).
64
+ # `jq` 를 쓰지 않는 이유: 훅은 jq 미설치 환경에서도 돌아야 한다 (cli-development.md).
65
+ ESCAPED=$(printf '%s' "$MSG" | sed -e 's/\\/\\\\/g' -e 's/"/\\"/g')
66
+
56
67
  cat <<EOF
57
68
  {
58
- "priority": "INFO",
59
- "message": "$MSG"
69
+ "hookSpecificOutput": {
70
+ "hookEventName": "SessionStart",
71
+ "additionalContext": "$ESCAPED"
72
+ }
60
73
  }
61
74
  EOF