coxpit 6.3.3 → 6.3.5

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/hud.ts +39 -9
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coxpit",
3
- "version": "6.3.3",
3
+ "version": "6.3.5",
4
4
  "description": "Self-hosted cockpit for running a fleet of AI coding agents across your own machines — parallel worktree runs, live board, compare & merge, web terminal, design capture.",
5
5
  "type": "module",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
package/src/hud.ts CHANGED
@@ -5,10 +5,13 @@
5
5
  // ① 알약으로 한눈에 본다(점 + 대기 수) ② 펼쳐서 나를 기다리는 것부터 훑는다
6
6
  // ③ 한 줄을 고르면 **목록 옆에** 상세가 열린다 ④ 대기 중인 에이전트에게 코크핏을 열지 않고 답한다
7
7
  //
8
- // [!] 이 실행분은 **서빙되는 페이지까지**다. 창(프레임리스·항상 위)·전역 단축키·크기 변경·
9
- // 드래그는 뒤따르는 데스크톱 작업(K1/K2)이다. 여기서는 원하는 크기 상태만
10
- // <html data-hud="pill|list|detail"> 에 적어 둔다 데스크톱이 나중에 그걸 읽어 창을 줄이고 늘린다.
11
- // 페이지 자신은 값으로 **안에서** 레이아웃만 바꾼다(브라우저에서 단독으로 돌아간다).
8
+ // [!] 이 페이지는 **브라우저에서 단독으로 돈다**. 창(프레임리스·항상 위)·전역 단축키·크기 변경은
9
+ // 데스크톱 (K1/K2, desktop/main.cjs)이고, 여기는 그쪽을 줄도 모른다 —
10
+ // 배치 상태를 <html data-hud="pill|list|detail"> 에 적고, 창이 붙어 있을 때만
11
+ // window.coxpitHud.size({state,w,h}) "이만큼 필요하다"고 말할 뿐이다(없으면 아무 일도 없다).
12
+ // 창을 실제로 줄이고 늘리는 것도, 화면 밖으로 안 나가게 물리는 것도 전부 메인 프로세스다.
13
+ // 보이는데 열리지 않는 알약은 없느니만 못하다 — 눌러서 펼쳐져야 하고 그러면서도 끌어 옮길 수 있어야 하니,
14
+ // drag 영역과 클릭 대상은 같은 요소일 수 없다: 알약은 눌리고, 창은 알약 안의 홈(.pgrip)으로 옮긴다.
12
15
  //
13
16
  // 데이터는 전부 코크핏이 이미 읽는 것: GET /api/fleet(+ agentStates · real) 과 /ws 델타.
14
17
  // 새 창구는 하나뿐 — POST /api/runs/:id/input (살아 있는 tmux 에 한 줄 써 넣기, getScrollback 의 쓰기 쌍둥이).
@@ -52,11 +55,18 @@ export const HUD_HTML = /* html */ `<!doctype html>
52
55
  html[data-hud="pill"] body{align-items:flex-start}
53
56
 
54
57
  /* ── K3. 접힌 알약 — 이것이 평상시의 전부다 ───────────────────────────── */
55
- .pill{display:inline-flex;align-items:center;gap:8px;height:26px;padding:0 11px;border-radius:999px;
58
+ .pill{display:inline-flex;align-items:center;gap:8px;height:26px;padding:0 11px 0 7px;border-radius:999px;
56
59
  background:var(--surface);border:1px solid var(--line);box-shadow:0 8px 28px rgba(0,0,0,.35);
57
- font-family:var(--mono);font-size:11px;color:var(--muted);-webkit-app-region:drag}
60
+ font-family:var(--mono);font-size:11px;color:var(--muted)}
58
61
  .pill:hover{border-color:var(--line-hi);color:var(--ink)}
59
- .pill>*{-webkit-app-region:no-drag}
62
+ /* app-region: 프레임 없는 창(K1)에서 drag 영역은 클릭을 **삼킨다** — 창이 대신 움직인다.
63
+ 그래서 알약 자체는 no-drag(눌러서 펼치는 것이 알약의 일이고, 옮기는 일보다 훨씬 잦다)이고,
64
+ 창을 옮기는 손잡이는 알약 안의 작은 홈 하나뿐이다. 브라우저에서는 둘 다 아무 뜻도 없다. */
65
+ .pill,.pill>*{-webkit-app-region:no-drag}
66
+ .pill>.pgrip{-webkit-app-region:drag}
67
+ .pgrip{flex:none;color:var(--faint);font-family:var(--mono);font-size:10px;line-height:1;
68
+ letter-spacing:-.06em;padding:0 2px;opacity:.65;cursor:grab}
69
+ .pill:hover .pgrip{opacity:1}
60
70
  .pdots{display:inline-flex;align-items:center;gap:4px}
61
71
  .pwait{color:var(--blocked);font-size:11px;letter-spacing:.02em}
62
72
  .pquiet{color:var(--faint);font-size:10.5px}
@@ -159,8 +169,10 @@ export const HUD_HTML = /* html */ `<!doctype html>
159
169
  </style>
160
170
  </head>
161
171
  <body>
162
- <!-- K3 — 접힌 알약. 누르면 펼쳐진다(창 크기는 데스크톱이 나중에 data-hud 를 보고 맞춘다). -->
172
+ <!-- K3 — 접힌 알약. 누르면 펼쳐진다(창 크기는 데스크톱이 나중에 data-hud 를 보고 맞춘다).
173
+ 맨 앞의 홈(.pgrip)만이 창을 끄는 손잡이다 — 나머지는 전부 눌리는 자리다. -->
163
174
  <button type="button" id="pill" class="pill" aria-label="coxpit fleet">
175
+ <span class="pgrip" id="pillGrip" aria-hidden="true" title="끌어서 창 옮기기">⠿</span>
164
176
  <span class="pdots" id="pillDots"></span>
165
177
  <span class="pwait" id="pillWait" hidden></span>
166
178
  <span class="pquiet" id="pillQuiet" hidden>quiet</span>
@@ -194,12 +206,28 @@ export const HUD_HTML = /* html */ `<!doctype html>
194
206
  }
195
207
 
196
208
  // ── 레이아웃 상태 = 데스크톱이 읽어 갈 자리 ────────────────────────────
197
- // 창을 줄이고 늘리는 것은 **여기가 아니다**(K1, 데스크톱 작업). 이 페이지는 원하는 크기를
209
+ // 창을 줄이고 늘리는 것은 **여기가 아니다**(K1, 데스크톱 ). 이 페이지는 원하는 크기를
198
210
  // <html data-hud> 에 적어 두고, 자기 안에서는 그 값으로 배치만 바꾼다.
211
+ // 데스크톱 창에 실려 있으면 그 크기를 한 번 더 **말해 준다** — 창을 만지는 쪽은 언제나 저쪽이다.
212
+ // 알약 120x26 · 목록 250 · 상세 570 (+ 지면 여백 6px 양쪽). 창은 이 값을 화면 크기로 한 번 더 물린다.
213
+ var HUD_SIZE={ pill:{w:132,h:38}, list:{w:262,h:380}, detail:{w:582,h:440} };
214
+ function reportSize(next){
215
+ var api=window.coxpitHud;
216
+ if(!api||typeof api.size!=='function') return; // 브라우저에서 단독으로 열린 경우 — 아무 일도 없다
217
+ var s=HUD_SIZE[next]||HUD_SIZE.pill;
218
+ var w=s.w, h=s.h;
219
+ // 알약만은 **재서** 말한다 — 폭이 점 수에 따라 달라져서 고정값이면 잘리거나 빈자리가 남는다.
220
+ if(next==='pill'){
221
+ var el=$('pill');
222
+ if(el&&el.offsetWidth){ w=Math.ceil(el.offsetWidth)+12; h=Math.ceil(el.offsetHeight)+12; }
223
+ }
224
+ try{ api.size({state:next, w:w, h:h}); }catch(e){}
225
+ }
199
226
  var layout='pill';
200
227
  function setLayout(next){
201
228
  layout=next;
202
229
  document.documentElement.setAttribute('data-hud', next);
230
+ reportSize(next);
203
231
  if(next==='pill'){ try{ $('pill').focus(); }catch(e){} }
204
232
  }
205
233
  function expand(){ if(layout==='pill'){ setLayout('list'); render(); } }
@@ -335,6 +363,8 @@ ${ACTIVITY_JS}
335
363
  if(b.wait.length){ w.hidden=false; w.textContent='\\u25d4 '+b.wait.length; q.hidden=true; }
336
364
  else { w.hidden=true; q.hidden=false; q.textContent=b.run.length?(b.run.length+' running'):'quiet'; }
337
365
  $('pill').title = b.wait.length ? (b.wait.length+' 개가 답을 기다립니다') : (b.run.length+' 개가 도는 중');
366
+ // 점이 늘고 줄면 알약의 폭도 달라진다 — 떠 있는 창이라면 그때마다 다시 말해 준다.
367
+ if(layout==='pill') reportSize('pill');
338
368
  }
339
369
 
340
370
  // ── K5. 상세 — 고른 행 하나. 목록은 그대로 옆에 남는다. ────────────────