pi-sdk-web 0.4.5 → 0.4.6

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.
@@ -1331,6 +1331,12 @@ class PiWebClient {
1331
1331
  if (!div) {
1332
1332
  div = this.createToolBlock('bash', { command: this.pendingBashCommand || '' }, key);
1333
1333
  div.className = 'tool-block pending';
1334
+ // Running indicator (spinner + label) - makes it obvious the stream
1335
+ // is still live even when output is quiet; removed on bash_result.
1336
+ const run = document.createElement('span');
1337
+ run.className = 'bash-running';
1338
+ run.textContent = '⟳ running';
1339
+ div.querySelector('.tool-title')?.appendChild(run);
1334
1340
  // Stop button in the title row (TUI Ctrl+C equivalent): abort_bash
1335
1341
  // kills only this running bash. Removed when the block finalizes.
1336
1342
  const stopBtn = document.createElement('button');
@@ -1351,7 +1357,14 @@ class PiWebClient {
1351
1357
  const bashPending = document.getElementById('bash-pending');
1352
1358
  if (bashPending) {
1353
1359
  bashPending.appendChild(div);
1360
+ // Area-level status line at the TAIL (always visible even when the
1361
+ // block's own title scrolled out of view while output streams).
1362
+ const statusLine = document.createElement('div');
1363
+ statusLine.className = 'bash-stream-status';
1364
+ statusLine.textContent = '⟳ running…';
1365
+ bashPending.appendChild(statusLine);
1354
1366
  bashPending.style.display = 'block';
1367
+ bashPending.scrollTop = bashPending.scrollHeight; // keep tail visible
1355
1368
  } else {
1356
1369
  this.contentEl.appendChild(div);
1357
1370
  }
@@ -1362,6 +1375,12 @@ class PiWebClient {
1362
1375
  const full = (div.dataset.fullOutput || '') + delta;
1363
1376
  div.dataset.fullOutput = full;
1364
1377
  this.applyToolPreview(div);
1378
+ // Keep the stream tail (and its running status line) visible inside the
1379
+ // pending area while output is coming in.
1380
+ const bashPending = document.getElementById('bash-pending');
1381
+ if (bashPending && bashPending.contains(div)) {
1382
+ bashPending.scrollTop = bashPending.scrollHeight;
1383
+ }
1365
1384
  if (this.wasAtBottom()) this.scrollToBottom();
1366
1385
  }
1367
1386
 
@@ -1384,12 +1403,16 @@ class PiWebClient {
1384
1403
  const bashPending = document.getElementById('bash-pending');
1385
1404
  if (bashPending && bashPending.contains(div)) {
1386
1405
  this.contentEl.appendChild(div);
1406
+ // Remove the area-level running status line, then hide the empty area.
1407
+ bashPending.querySelectorAll('.bash-stream-status').forEach((el) => el.remove());
1387
1408
  if (bashPending.children.length === 0) {
1388
1409
  bashPending.style.display = 'none';
1389
1410
  }
1390
1411
  this.scrollToBottom();
1391
1412
  }
1392
- // Bash done: the stop button is no longer relevant.
1413
+ // Bash done: the running indicator and stop button are no longer
1414
+ // relevant.
1415
+ div.querySelector('.bash-running')?.remove();
1393
1416
  div.querySelector('.bash-stop-btn')?.remove();
1394
1417
 
1395
1418
  const isError = result.exitCode !== undefined && result.exitCode !== 0;
@@ -549,8 +549,11 @@ body {
549
549
  pendingMessagesContainer). Moved into the message flow on completion. */
550
550
  #bash-pending {
551
551
  display: none;
552
- padding: 4px 12px;
553
- border-top: 1px solid var(--border);
552
+ padding: 8px 12px;
553
+ margin: 6px 8px 4px;
554
+ border: 1px solid var(--border);
555
+ border-radius: 6px;
556
+ background: var(--code-bg);
554
557
  font-size: 13px;
555
558
  /* ~10 lines of output visible; scrolling inside the block for more */
556
559
  max-height: calc(10 * 1.5em);
@@ -569,6 +572,38 @@ body {
569
572
  vertical-align: middle;
570
573
  }
571
574
 
575
+ .bash-running {
576
+ margin-left: 8px;
577
+ font-size: 11px;
578
+ color: var(--accent);
579
+ vertical-align: middle;
580
+ }
581
+
582
+ .bash-running::before {
583
+ content: '⟳';
584
+ display: inline-block;
585
+ margin-right: 4px;
586
+ animation: bash-spin 1s linear infinite;
587
+ }
588
+
589
+ @keyframes bash-spin {
590
+ from { transform: rotate(0deg); }
591
+ to { transform: rotate(360deg); }
592
+ }
593
+
594
+ .bash-stream-status {
595
+ margin-top: 2px;
596
+ font-size: 11px;
597
+ color: var(--accent);
598
+ }
599
+
600
+ .bash-stream-status::before {
601
+ content: '⟳';
602
+ display: inline-block;
603
+ margin-right: 4px;
604
+ animation: bash-spin 1s linear infinite;
605
+ }
606
+
572
607
  .bash-stop-btn:hover {
573
608
  background: color-mix(in srgb, var(--error) 15%, transparent);
574
609
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-sdk-web",
3
- "version": "0.4.5",
3
+ "version": "0.4.6",
4
4
  "description": "Browser Web access for Pi (AI coding agent) via the Pi SDK - standalone module, zero modification to Pi itself",
5
5
  "type": "module",
6
6
  "bin": {