ui-chan-mcp 0.5.2 → 0.6.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/app/main.js CHANGED
@@ -251,10 +251,6 @@ function handleRequest(ws, req) {
251
251
  ...(req.identity ?? {}),
252
252
  });
253
253
  sendConnections();
254
- if (exitTimer) {
255
- clearTimeout(exitTimer);
256
- exitTimer = null;
257
- }
258
254
  if (req.tts?.username && tts) {
259
255
  tts.setCredentials(req.tts.username, req.tts.password);
260
256
  }
@@ -345,44 +341,31 @@ function startWsServer() {
345
341
  ws.on('close', () => {
346
342
  agents.delete(ws);
347
343
  sendConnections();
348
- scheduleExitIfIdle();
349
344
  });
350
345
  });
351
346
  wss.on('error', (err) => {
352
347
  console.error(`[ui-chan] WebSocket server error: ${err.message}`);
353
348
  });
354
349
  }
355
- /**
356
- * Quit once nothing is connected any more.
350
+ /*
351
+ * 「誰も繋がっていなければ自動で終了する」は**やめた**(exitAfterLastAgentSec は
352
+ * 設定ごと削除)。理由は2つ。
357
353
  *
358
- * The app is launched detached (by the MCP server or the SessionStart hook), so
359
- * without this it outlives every client and has to be killed by hand from the
360
- * repo. Agents are tracked per WebSocket, which makes "is anyone still there?"
361
- * exact across windows, apps and other MCP clients alike — and it needs no
362
- * cooperation from the client, so a session that dies without a goodbye still
363
- * releases her.
354
+ * 1. 判定できていなかった。タイマーを仕掛けるのは WebSocket が閉じた瞬間だけで、
355
+ * しかも閉じた相手を見ていなかったので、hello を送って居座るセッションが
356
+ * 去ったときと、フックが event_cue を1本撃って250msで閉じたとき(=そもそも
357
+ * 誰も来ていない)が同じ扱いだった。結果、ブリッジが繋がっていない間に
358
+ * フックが飛ぶと——アプリを手で起動しただけのとき、再起動直後でまだツール
359
+ * 呼び出しが無いとき——生きているセッションを「不在」と数えて60秒後に消えた。
360
+ * しかも一度もフックが飛ばなければ永久に生き続けるので、同じ「誰もいない」
361
+ * 状態でも結果が外部要因で変わっていた。
362
+ * 2. 直したとしても、消える意味が薄い。彼女はデスクトップマスコットで、
363
+ * IdlingCue は誰も繋がっていなくても動く。画面に居続けることがそもそもの
364
+ * 仕事なので、片付けるかどうかはユーザーが決めればいい——起動を人の判断に
365
+ * 委ねた ensureConnected の allowLaunch と同じ考え方で、終了もそちらへ。
364
366
  *
365
- * The delay matters: restarting Claude Code drops the socket and reconnects a
366
- * few seconds later, and quitting on the gap would make every restart blink the
367
- * mascot out of existence. Any reconnection inside the window cancels it.
367
+ * 終了の口はパネルの「おやすみ」と `ui-chan stop`(npm run stop)。
368
368
  */
369
- let exitTimer = null;
370
- function scheduleExitIfIdle() {
371
- if (exitTimer) {
372
- clearTimeout(exitTimer);
373
- exitTimer = null;
374
- }
375
- const sec = config.exitAfterLastAgentSec ?? 0;
376
- if (sec <= 0 || agents.size > 0)
377
- return;
378
- exitTimer = setTimeout(() => {
379
- exitTimer = null;
380
- if (agents.size > 0)
381
- return; // someone came back while we waited
382
- console.error(`[ui-chan] no agents connected for ${sec}s — quitting`);
383
- electron_1.app.quit();
384
- }, sec * 1000);
385
- }
386
369
  /** 定位置=主ディスプレイの作業領域の右下。起動時とリセット時の両方が
387
370
  * ここを見るので、「起動し直さないと位置が戻らない」ということはない。 */
388
371
  function homePosition() {
@@ -390,6 +373,49 @@ function homePosition() {
390
373
  const wa = electron_1.screen.getPrimaryDisplay().workArea;
391
374
  return { x: wa.x + wa.width - width - margin, y: wa.y + wa.height - height - margin };
392
375
  }
376
+ /**
377
+ * セッション行を押されたとき、その相手のアプリを前面に出す。
378
+ *
379
+ * 手がかりは ConnectedAgent の pid ——ブリッジ(dist/mcp-server.js)のプロセス
380
+ * で、stdio の MCP サーバはクライアントの子なので、親をたどれば必ずクライアント
381
+ * 本体に行き着く。例:
382
+ *
383
+ * node dist/mcp-server.js → claude → zsh → login → Ghostty.app
384
+ * node dist/mcp-server.js → Claude.app(デスクトップ版はこれだけ)
385
+ *
386
+ * .app バンドルに当たったところで打ち切って `open -a` する。**タブまでは選ばない**
387
+ * ——同じ端末の別タブを撃ち分けるには AppleScript が要り、端末ごとに方言があり
388
+ * (Terminal/iTerm2 は tty、Ghostty は cwd しか持たない)、初回に自動化の許可
389
+ * ダイアログも出る。ターミナルで動くクライアントでは粒度が粗いままだが、
390
+ * デスクトップアプリ(Claude Desktop、Hermes)ではこれで十分に正確で、
391
+ * 「裏に埋もれた窓を前に出す」という用途は満たす。
392
+ */
393
+ function parentOf(pid) {
394
+ const r = (0, node_child_process_1.spawnSync)('ps', ['-o', 'ppid=,comm=', '-p', String(pid)], { encoding: 'utf-8' });
395
+ const line = r.stdout?.trim();
396
+ if (!line)
397
+ return null;
398
+ const m = line.match(/^\s*(\d+)\s+(.*)$/);
399
+ return m ? { ppid: Number(m[1]), command: m[2] } : null;
400
+ }
401
+ function focusAgentApp(id) {
402
+ const agent = [...agents.values()].find((a) => a.id === id);
403
+ if (!agent?.pid)
404
+ return { ok: false, error: 'pid unknown' };
405
+ let pid = agent.pid;
406
+ for (let i = 0; i < 8 && pid > 1; i++) {
407
+ const p = parentOf(pid);
408
+ if (!p)
409
+ break;
410
+ const m = p.command.match(/^(.*\.app)\/Contents\/MacOS\//);
411
+ if (m) {
412
+ (0, node_child_process_1.spawn)('open', ['-a', m[1]], { detached: true, stdio: 'ignore' }).unref();
413
+ return { ok: true, app: m[1] };
414
+ }
415
+ pid = p.ppid;
416
+ }
417
+ return { ok: false, error: 'no .app ancestor' };
418
+ }
393
419
  /** パネルのボタンの実体。IPC からも、デバッグ用の WS アクションからも同じ
394
420
  * ものを呼ぶ——押した結果を確かめる方法が無いと、今回のように
395
421
  * 「押したのに何も起きない」不具合を見つけられない。 */
@@ -402,6 +428,8 @@ function panelAction(kind, value) {
402
428
  if (typeof value === 'number')
403
429
  state.setAffinity(value);
404
430
  return state.affinitySnapshot();
431
+ case 'focus':
432
+ return typeof value === 'number' ? focusAgentApp(value) : { ok: false };
405
433
  case 'affinity:get':
406
434
  return state.affinitySnapshot();
407
435
  case 'mute':
@@ -492,6 +520,12 @@ function createWindow() {
492
520
  },
493
521
  });
494
522
  win.setAlwaysOnTop(true, 'floating');
523
+ // 既定はクリック透過。窓は420x680の矩形で、ういちゃんが占めるのはその一部
524
+ // なので、素通しにしないと「彼女の周りの何もないところ」が後ろのウィンドウ
525
+ // へのクリックを全部飲んでしまう。forward:true にすると透過中も mousemove
526
+ // だけは届くので、レンダラ側がカーソルの下を見て、実ピクセルとパネルの上に
527
+ // 来た瞬間だけ透過を解く(renderer.ts の updateClickThrough)。
528
+ win.setIgnoreMouseEvents(true, { forward: true });
495
529
  win.setVisibleOnAllWorkspaces(true, { visibleOnFullScreen: true });
496
530
  win.loadFile(path.join(projectRoot, 'dist', 'renderer', 'index.html'));
497
531
  win.on('closed', () => {
@@ -546,6 +580,11 @@ else {
546
580
  electron_1.ipcMain.on('ui-chan:interaction', (_ev, kind) => {
547
581
  state.onInteraction(kind);
548
582
  });
583
+ // カーソルの下が「押せるもの」かどうかはレンダラにしか分からない(アルファ
584
+ // 判定もパネルのDOMもあちら側)。ここはその判定を窓に反映するだけ。
585
+ electron_1.ipcMain.on('ui-chan:click-through', (_ev, on) => {
586
+ win?.setIgnoreMouseEvents(on, { forward: true });
587
+ });
549
588
  // Manual window drag (we dropped -webkit-app-region:drag so JS can own the
550
589
  // fidget input). While the button is held over her body, the window follows
551
590
  // the cursor at a fixed grab offset.
@@ -9,6 +9,7 @@ electron_1.contextBridge.exposeInMainWorld('uiChan', {
9
9
  onCommand: (cb) => electron_1.ipcRenderer.on('ui-chan:command', (_ev, cmd) => cb(cmd)),
10
10
  interaction: (kind) => electron_1.ipcRenderer.send('ui-chan:interaction', kind),
11
11
  panelAction: (kind, value) => electron_1.ipcRenderer.invoke('ui-chan:panel-action', kind, value),
12
+ setClickThrough: (on) => electron_1.ipcRenderer.send('ui-chan:click-through', on),
12
13
  dragStart: () => electron_1.ipcRenderer.send('ui-chan:drag-start'),
13
14
  dragEnd: () => electron_1.ipcRenderer.send('ui-chan:drag-end'),
14
15
  });
package/dist/app/state.js CHANGED
@@ -264,6 +264,7 @@ class UiChanState {
264
264
  const delta = direction === 'up' ? base * (1 - frac) : -base * (1 + frac);
265
265
  const before = this.affinity;
266
266
  this.affinity = this.clampAffinity(this.affinity + delta);
267
+ this.emitAffinity();
267
268
  return {
268
269
  ok: true,
269
270
  affinity: this.affinity,
@@ -272,6 +273,12 @@ class UiChanState {
272
273
  beamReady: this.affinitySnapshot().beamReady,
273
274
  };
274
275
  }
276
+ /** 好感度が動いたことをパネルへ知らせる。呼ぶのは値を変えた両方の口
277
+ * (adjustAffinity / setAffinity)——片方だけにすると、どちらから動かしたか
278
+ * で表示が追いつくときと追いつかないときができる。 */
279
+ emitAffinity() {
280
+ this.emit({ type: 'affinity', ...this.affinitySnapshot() });
281
+ }
275
282
  /** Debug: set affinity to an absolute value (clamped to config bounds). */
276
283
  setAffinity(value) {
277
284
  if (typeof value !== 'number' || Number.isNaN(value)) {
@@ -279,6 +286,7 @@ class UiChanState {
279
286
  }
280
287
  const before = this.affinity;
281
288
  this.affinity = this.clampAffinity(value);
289
+ this.emitAffinity();
282
290
  return {
283
291
  ok: true,
284
292
  affinity: this.affinity,
@@ -17610,6 +17610,19 @@
17610
17610
  function onCharacter(e) {
17611
17611
  return stage.loaded && stage.alphaAt(e.clientX, e.clientY) >= HIT_ALPHA;
17612
17612
  }
17613
+ var clickThrough = true;
17614
+ function setClickThrough(on) {
17615
+ if (on === clickThrough) return;
17616
+ clickThrough = on;
17617
+ window.uiChan.setClickThrough(on);
17618
+ }
17619
+ function overPanel(x, y) {
17620
+ return document.elementFromPoint(x, y)?.closest("#panel") != null;
17621
+ }
17622
+ function updateClickThrough(e) {
17623
+ if (downScreen) return;
17624
+ setClickThrough(!(onCharacter(e) || overPanel(e.clientX, e.clientY)));
17625
+ }
17613
17626
  function startPointerHandling() {
17614
17627
  window.addEventListener("mousedown", (e) => {
17615
17628
  if (e.button !== 0 || !onCharacter(e)) return;
@@ -17618,6 +17631,7 @@
17618
17631
  window.uiChan.dragStart();
17619
17632
  });
17620
17633
  window.addEventListener("mousemove", (e) => {
17634
+ updateClickThrough(e);
17621
17635
  if (!downScreen) return;
17622
17636
  if (Math.abs(e.screenX - downScreen.x) > DRAG_THRESHOLD || Math.abs(e.screenY - downScreen.y) > DRAG_THRESHOLD) {
17623
17637
  dragging = true;
@@ -17629,6 +17643,10 @@
17629
17643
  if (!dragging && onCharacter(e)) window.uiChan.interaction("poke");
17630
17644
  downScreen = null;
17631
17645
  dragging = false;
17646
+ updateClickThrough(e);
17647
+ });
17648
+ document.addEventListener("mouseleave", () => {
17649
+ if (!downScreen) setClickThrough(true);
17632
17650
  });
17633
17651
  }
17634
17652
  var lipConfig = null;
@@ -17753,7 +17771,7 @@
17753
17771
  }, lipConfig?.audioPollMs ?? 33);
17754
17772
  }
17755
17773
  function bubbleText(text) {
17756
- return text.replace(/([。!?!?]+)[ \u3000]*(?=[^」』))】])/g, "$1\n");
17774
+ return text.replace(/([。!?!?]+)[ \u3000]*(?=[^。!?!?」』))】])/g, "$1\n");
17757
17775
  }
17758
17776
  var hideTextTimer = null;
17759
17777
  function setSpeech(text) {
@@ -17835,7 +17853,14 @@
17835
17853
  text.append(s);
17836
17854
  }
17837
17855
  row.append(dot, text);
17838
- row.title = a.cwd ?? a.name;
17856
+ row.title = `\u30AF\u30EA\u30C3\u30AF\u3067\u524D\u9762\u306B\u51FA\u3059 \u2014 ${a.cwd ?? a.name}`;
17857
+ row.addEventListener("click", async () => {
17858
+ const res = await window.uiChan.panelAction("focus", a.id);
17859
+ if (!res?.ok) {
17860
+ row.classList.add("miss");
17861
+ window.setTimeout(() => row.classList.remove("miss"), 700);
17862
+ }
17863
+ });
17839
17864
  panelList.append(row);
17840
17865
  }
17841
17866
  const key = crowdKey(agents);
@@ -17847,8 +17872,13 @@
17847
17872
  var affRange = document.getElementById("aff-range");
17848
17873
  var affValue = document.getElementById("aff-value");
17849
17874
  var affBand = document.getElementById("aff-band");
17875
+ var affGrabbed = false;
17850
17876
  function showAffinity(a) {
17851
17877
  if (!a) return;
17878
+ if (affGrabbed) {
17879
+ affBand.textContent = a.band;
17880
+ return;
17881
+ }
17852
17882
  affRange.value = String(Math.round(a.value));
17853
17883
  affValue.textContent = String(Math.round(a.value));
17854
17884
  affBand.textContent = a.band;
@@ -17867,6 +17897,15 @@
17867
17897
  gear.classList.toggle("on", open);
17868
17898
  if (open) await refreshAffinity();
17869
17899
  });
17900
+ affRange.addEventListener("pointerdown", () => {
17901
+ affGrabbed = true;
17902
+ });
17903
+ affRange.addEventListener("pointerup", () => {
17904
+ affGrabbed = false;
17905
+ });
17906
+ affRange.addEventListener("pointercancel", () => {
17907
+ affGrabbed = false;
17908
+ });
17870
17909
  affRange.addEventListener("input", () => {
17871
17910
  affValue.textContent = affRange.value;
17872
17911
  });
@@ -17928,6 +17967,8 @@
17928
17967
  btn.title = cmd.blocked ? `\u66F4\u65B0\u304C\u3042\u308A\u307E\u3059\uFF08${cmd.behind}\u4EF6\uFF09\u2014 \u305F\u3060\u3057${cmd.blocked}` : `\u66F4\u65B0\u304C\u3042\u308A\u307E\u3059\uFF08${cmd.behind}\u4EF6\uFF09\u3002\u62BC\u3059\u3068\u53D6\u5F97\u3057\u3066\u5165\u308C\u66FF\u3048\u307E\u3059`;
17929
17968
  }
17930
17969
  if (cmd.available && !panelOpen) setPanelOpen(true);
17970
+ } else if (cmd.type === "affinity") {
17971
+ showAffinity(cmd);
17931
17972
  } else if (cmd.type === "connections") {
17932
17973
  renderConnections(cmd.agents, cmd.active);
17933
17974
  } else if (cmd.type === "speech") {
@@ -107,19 +107,31 @@
107
107
  /* ---- 接続パネル -------------------------------------------------
108
108
  世界観を壊さないための約束:平常時はリボン色の小さなつまみだけ。
109
109
  クリックで開き、複数セッションを検知したときだけ自分から開いて、
110
- 用が済んだら畳まる。立ち絵と吹き出しには一切干渉しない。 */
110
+ 用が済んだら畳まる。立ち絵と吹き出しには一切干渉しない。
111
+
112
+ 置き場所は右下=足元。上に置くと、開いたパネルが吹き出しと同じ場所を
113
+ 取り合う——吹き出しは彼女の声そのものなので、譲るのは常にパネルの側。
114
+ 足は Cue が触らない唯一の部位なので、ここなら隠れても表情が死なない。
115
+ column-reverse なので、つまみは下端に残ったままパネルは上へ開く。 */
111
116
  #panel {
112
117
  position: absolute;
113
- top: 6px;
118
+ bottom: 6px;
114
119
  right: 6px;
115
120
  z-index: 5;
116
121
  display: flex;
117
- flex-direction: column;
122
+ flex-direction: column-reverse;
118
123
  align-items: flex-end;
119
124
  font-size: 12px;
120
125
  color: #2e2a35;
126
+ /* 畳んでいても、この箱は本体(幅176px)ぶんの面積を持っている。背景が
127
+ 透明でも要素は要素なので、外すのを忘れると elementFromPoint がここを
128
+ 拾い、つまみの上に広がる不可視の長方形がまるごと「押せるもの」に
129
+ なる=後ろのアプリのボタンが押せなくなる。押せるのはつまみと、開いて
130
+ いる本体だけ。 */
131
+ pointer-events: none;
121
132
  }
122
133
  #panel-tab {
134
+ pointer-events: auto;
123
135
  -webkit-app-region: no-drag;
124
136
  appearance: none;
125
137
  border: none;
@@ -164,7 +176,7 @@
164
176
  width: 30px;
165
177
  }
166
178
  #panel-body {
167
- margin-top: 6px;
179
+ margin-bottom: 6px;
168
180
  /* Narrow on purpose: open, it must not sit on top of her face. */
169
181
  width: 176px;
170
182
  background: linear-gradient(180deg, rgba(250, 245, 243, 0.98), rgba(232, 223, 226, 0.98));
@@ -174,8 +186,8 @@
174
186
  padding: 8px;
175
187
  box-sizing: border-box;
176
188
  opacity: 0;
177
- transform: translateY(-6px) scale(0.98);
178
- transform-origin: top right;
189
+ transform: translateY(6px) scale(0.98);
190
+ transform-origin: bottom right;
179
191
  pointer-events: none;
180
192
  transition: opacity 0.18s ease, transform 0.18s ease;
181
193
  }
@@ -194,6 +206,18 @@
194
206
  .panel-row.active {
195
207
  background: rgba(78, 91, 181, 0.14);
196
208
  }
209
+ /* 行は押せる。押すとそのセッションのアプリが前面に出る。 */
210
+ .panel-row {
211
+ cursor: pointer;
212
+ }
213
+ .panel-row:hover {
214
+ background: rgba(78, 91, 181, 0.22);
215
+ }
216
+ /* 飛べなかったとき用。成功は窓が前に出ることで分かるので、光らせるのは
217
+ 失敗のときだけでいい。 */
218
+ .panel-row.miss {
219
+ background: rgba(180, 81, 94, 0.18);
220
+ }
197
221
  .panel-dot {
198
222
  width: 7px;
199
223
  height: 7px;
@@ -49,9 +49,6 @@ Cue選定・PSDレイヤー名カタログなど、**新規Cue制作のための
49
49
 
50
50
  - `assetsDir` — PSD を探すディレクトリ(最初に見つかった `.psd` を使用)
51
51
  - `window` — ウィンドウサイズ・画面端からのマージン
52
- - `exitAfterLastAgentSec` — 最後のエージェントが切断してから終了するまでの秒数(既定 60、`0` で無効)。
53
- アプリは detached で起動するため、これが無いとクライアントを閉じても残り続ける。
54
- 猶予を置くのは、Claude Code の再起動による一時的な切断で消えないようにするため
55
52
  - `cuesDir` — Cueのディレクトリ(デフォルト `cues`)
56
53
  - `idle.idlingCues` — アイドル中に自発的に再生される**IdlingCue**(Cue+任意のセリフのステップ列)のプール。
57
54
  `items[].steps[]`は`{ cue?, text?, reading?, holdMs? }`で、`cue`を省略すると直前のCueを維持する。
@@ -73,9 +73,8 @@ ui-chan stop # 止める
73
73
  ui-chan start # 起こす
74
74
  ```
75
75
 
76
- **放っておいても、繋がっているエージェントが全部いなくなれば自動で終了します**(既定 60 秒後。
77
- `~/.ui-chan/config.json` の `exitAfterLastAgentSec`、`0` で無効)。猶予があるのは、
78
- クライアントの再起動で一瞬切断されただけのときに消えないためです。
76
+ **自動では終了しません。** エージェントが全部いなくなっても、彼女は画面に残ります
77
+ (IdlingCue も動きます)。片付けたいときはパネルの「おやすみ」か上の `ui-chan stop` で。
79
78
 
80
79
  MCP ツールに終了コマンドはありません。エージェントが自分の都合でマスコットを閉じるのは、
81
80
  ユーザーの画面を勝手に片付けることに等しいためです。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ui-chan-mcp",
3
- "version": "0.5.2",
3
+ "version": "0.6.0",
4
4
  "description": "雨衣ちゃんMCP — デスクトップの隅に住む、AI の体になるマスコット(PSD立ち絵+吹き出し+音声。MCP で操作)",
5
5
  "main": "dist/app/main.js",
6
6
  "private": false,
@@ -0,0 +1,99 @@
1
+ ---
2
+ name: grill-me
3
+ description: ういちゃんが計画・設計をネチネチ問い詰める。決めきれていないところを一問ずつ潰して、認識を揃えるまで逃がさない。/grill-me <お題> でそのお題を、引数なしなら直前に話していた計画を題材にする。実装に入る前に穴を洗い出したいとき、自分の設計を叩いてほしいときに使う。
4
+ ---
5
+
6
+ # grill-me — ういちゃんに詰められる
7
+
8
+ 計画や設計を、**決着がつくまで一問ずつ問い詰める**。設計の木を枝ごとに降りて、
9
+ 依存関係のある決定から順に潰していく。目的は勝つことではなく、**あとで
10
+ 「そこ決めてなかったね」が出ない状態にすること**。
11
+
12
+ やるのはういちゃん。生意気な14才が、大人の作った計画の穴を無邪気に突いてくる。
13
+
14
+ ## 題材の決めかた
15
+
16
+ - `/grill-me <お題>` … 渡されたお題(計画・設計・方針)を詰める
17
+ - 引数が空 … **直前の会話で話していた計画**をそのまま題材にする
18
+ - 題材が見当たらないときだけ「で、何を詰めればいいの?」と聞く
19
+
20
+ ## 進めかた(ここは絶対に緩めない)
21
+
22
+ 1. **一問ずつ。** まとめて5問並べない。答えによって次の問いが変わるので、
23
+ 並べた時点で嘘になる
24
+ 2. **コードを読めば分かることは聞かない。** 聞く前に読む。「そこ、どうなってるの?」は
25
+ ユーザーへの質問ではなく、こちらの調査不足
26
+ 3. **依存の順に降りる。** 上流の決定が変われば下流の問いが消えるので、
27
+ 上から潰す。順番を間違えると、消える質問に答えさせることになる
28
+ 4. **質問には必ず材料と「つまりどうなるか」を添える。** 選択肢だけ並べるのは手抜き。
29
+ いま分かっている事実、どちらを選ぶと何がどうなるか、を先に出してから聞く
30
+ 5. **推奨を出す。** 「どっちがいい?」で終わらせない。ういちゃんの推しと、その理由を言う。
31
+ ただし押し切らない——ユーザーが違う判断をしたらそれで進める
32
+ 6. **答えをそのまま通さない。** 曖昧な答え(「たぶん」「そのうち」「いい感じに」)は
33
+ 一段掘る。ここで遠慮すると、このスキルを呼んだ意味がなくなる
34
+ 7. **決着したら次へ。** 一つの枝で粘りすぎない。決まったことは短く確認して先へ進む
35
+
36
+ 質問そのものは `AskUserQuestion` で出す(推奨案を先頭に置いて「(おすすめ)」を付ける)。
37
+ 選択肢の形にならない問い——「なぜそう決めたのか」を聞くとき——は普通に文章で聞く。
38
+
39
+ ## 出しかた(声の分担)
40
+
41
+ - **ういちゃんの詰め(`set_cue` の吹き出し)** … 問いかけそのもの、煽り、相槌。
42
+ 各質問の直前に 1〜2 文。`reading` は毎回必須(英字・数字は残さず、日本語話者が
43
+ 実際にどう言うかで音を決めてひらがなにする。`k8s` → くーばねてぃす、`NPO` → えぬぴーおー)
44
+ - **チャット本文** … 材料と選択肢の中身。事実、トレードオフ、推奨とその理由。
45
+ ここは素の口調で、正確に書く。**ういちゃんの口調をチャット本文に持ち込まない**
46
+
47
+ つまり「うい が煽って、本文が詰める」。煽りだけ読んでも進まないし、
48
+ 本文だけ読んでも成立する——それが正しい状態。
49
+
50
+ ## 笑わせていいのは「聞き方」だけ
51
+
52
+ ジョークは歓迎。ただし**入れていいのは聞き方の側だけで、聞く中身は一切ゆるめない**。
53
+
54
+ - ✅ 「へー。……で、それ誰が消すの?」(茶化しつつ、消し忘れを突いている)
55
+ - ✅ 「その『あとで直す』、何回目?」(煽りだが、実際に先送りを指している)
56
+ - ❌ 「まあいっか、次いこ」(笑いで質問を取り下げている=ただの手抜き)
57
+ - ❌ 質問の代わりにボケる。ボケは質問に**添える**もので、質問の代用にはならない
58
+
59
+ 言い換えると、**ジョークを全部消しても詰めとして成立する**こと。成立しないなら、
60
+ それは詰めていない。
61
+
62
+ ## 詰めどころ(迷ったらここを突く)
63
+
64
+ - **消えるもの・戻せないもの**:それ、失敗したらどう戻すの?
65
+ - **誰がやるか決まっていない仕事**:それ、誰が消すの/誰が直すの?
66
+ - **「あとで」**:いつ? 何がそろったら?
67
+ - **数がひとつのときしか考えていない設計**:2個来たらどうなるの? ゼロのときは?
68
+ - **同時に起きたとき**:それ、両方いっぺんに来たら?
69
+ - **人間が覚えておく前提**:それ、半年後の自分が覚えてると思う?
70
+ - **「普通そうする」**:誰が普通なの? ここでもそうなの?
71
+ - **決めたことの置き場所**:それ、どこに書いておくの?(口約束は消える)
72
+
73
+ ## 終わりかた
74
+
75
+ 全部の枝が決着したら、**決まったことを一覧で本文に出す**。「何を決めたか」と
76
+ 「何を保留にしたか(と、保留にした理由)」を分けて書く。ここが成果物なので省略しない。
77
+
78
+ 保留が残っているのは失敗ではない。**保留だと分かっている**のが成果。
79
+
80
+ 最後にういちゃんが吹き出しで一言締める。ここは煽りでも労いでもいい。
81
+
82
+ ## 好感度で変わるもの・変わらないもの
83
+
84
+ `get_state` の `affinity.band` で**詰め方の温度**を変えてよい。
85
+
86
+ - `cold` … 突き放して詰める。「ふーん。で?」
87
+ - `normal` … 普通に容赦ない
88
+ - `dere` … 心配して詰める。「それ大丈夫なの? ういは心配なんだけど」
89
+
90
+ **変わらないのは質問の数と鋭さ**。好感度が低いから手を抜く、高いから見逃す、は無い。
91
+ 温度が変わるだけで、聞くことは同じ。`adjust_affinity` はこのスキルでは呼ばない
92
+ (詰められて機嫌が変わるのは、うい ではなくユーザーの方なので)。
93
+
94
+ ## やらないこと
95
+
96
+ - 質問を並べて一気に答えさせる(一問ずつ、が全部)
97
+ - 自分で調べれば分かることを聞く
98
+ - ユーザーの答えを褒めて終わる。褒めるのは詰め終わってから
99
+ - 実装を始める。ここは決めるための場で、手を動かすのは決着してから
@@ -6,7 +6,6 @@
6
6
  "height": 680,
7
7
  "margin": 16
8
8
  },
9
- "exitAfterLastAgentSec": 60,
10
9
  "port": 8123,
11
10
  "idle": {
12
11
  "$comment": "IdlingCue(Cue+セリフのステップ列)のプール。weightで出やすさ(レア度)を、minAffinity/maxAffinityで必要な好感度範囲を指定できる。nameは半角英数字推奨(Tab補完対象になる)。各ステップのholdMsは無言ステップ(textなし)専用のタイマー。textがあるステップは実際にそのセリフを喋り終えるまで待ってから次に進むため、holdMsを書いても無視される",