carmoji 0.3.10 → 0.3.12

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/carmoji.js +20 -9
  2. package/package.json +1 -1
package/carmoji.js CHANGED
@@ -1443,10 +1443,15 @@ async function main() {
1443
1443
  const cwd = payload.cwd || process.cwd();
1444
1444
  if (cwd) message.project = basename(cwd);
1445
1445
 
1446
- // Prose keeps its newlines and is clipped only when abnormally
1447
- // long; the one-line permission caption stays terse.
1448
- const clip = (text, cap) =>
1449
- String(text).replace(/[ \t]+/g, ' ').trim().slice(0, cap);
1446
+ // Prose ships whole and verbatim markdown indentation, code
1447
+ // blocks, and tables all matter to the phone's renderer, and the
1448
+ // history is a review surface, so no length cap either. Only
1449
+ // trailing per-line whitespace goes. Captions are one-liners, so
1450
+ // they still collapse and clip.
1451
+ const clipProse = (text) =>
1452
+ String(text).replace(/[ \t]+$/gm, '').trim();
1453
+ const clipCaption = (text, cap) =>
1454
+ String(text).replace(/\s+/g, ' ').trim().slice(0, cap);
1450
1455
 
1451
1456
  // On Stop the newest text block is the turn's reply; anything
1452
1457
  // before it — and everything on other hooks — is mid-procedure
@@ -1458,13 +1463,17 @@ async function main() {
1458
1463
  await sendAll(devices, { source, session: payload.session_id,
1459
1464
  host: hostname(), project: message.project,
1460
1465
  event: 'agent_note',
1461
- detail: clip(text, 2000) });
1466
+ detail: clipProse(text) });
1462
1467
  }
1463
1468
 
1464
1469
  // A snippet of human-readable context for the phone to show. The
1465
1470
  // turn's reply gets room — it feeds the reviewable chat history,
1466
1471
  // not just a caption — with the tail-window read as fallback when
1467
1472
  // the incremental scan saw nothing new.
1473
+ // tool_start also names what the tool is chewing on (the command,
1474
+ // the file) so the phone's history can say more than "Bash".
1475
+ const toolInfo = event.event === 'tool_start' && payload.tool_input
1476
+ ? summarizeToolInput(payload) : undefined;
1468
1477
  const detail = event.event === 'prompt'
1469
1478
  ? firstString(payload.prompt, payload.user_prompt, payload.userPrompt,
1470
1479
  payload.message, payload.input, payload.text)
@@ -1473,10 +1482,12 @@ async function main() {
1473
1482
  payload.tool_input ? summarizeToolInput(payload) : undefined)
1474
1483
  : isTurnDone
1475
1484
  ? (newTexts[newTexts.length - 1] ?? lastAssistantText(payload))
1476
- : undefined;
1477
- const detailCap = isTurnDone ? 2000
1478
- : event.event === 'prompt' ? 1000 : 140;
1479
- if (detail) message.detail = clip(detail, detailCap);
1485
+ : (toolInfo !== '{}' ? toolInfo : undefined);
1486
+ if (detail) {
1487
+ message.detail = isTurnDone || event.event === 'prompt'
1488
+ ? clipProse(detail)
1489
+ : clipCaption(detail, 140);
1490
+ }
1480
1491
  // Plan-window usage comes from Claude Code's local transcripts;
1481
1492
  // recompute only at turn boundaries.
1482
1493
  if (source === 'claude') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carmoji",
3
- "version": "0.3.10",
3
+ "version": "0.3.12",
4
4
  "description": "Bring your CarMoji pet to life from Claude Code / Codex — a LAN bridge that streams coding events to the CarMoji iOS app",
5
5
  "type": "module",
6
6
  "bin": {