pi-studio 0.11.3 → 0.11.4

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/CHANGELOG.md CHANGED
@@ -4,6 +4,17 @@ All notable changes to `pi-studio` are documented here.
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.11.4] — 2026-10-28
8
+
9
+ ### Changed
10
+ - In the new layout, **Working** looks more like agent-markdown-preview. The steps, and the prompt, sit on the pane's page colour, an open step has a rule under its line, and nothing inside a step has a frame of its own. The prompt, Thinking and Response read as prose; code and output stay monospaced.
11
+ - **Collapse all** folds the steps and the prompt and leaves what's inside them as it was. Steps that start later in the run arrive folded, until **Expand all**. A step's sections are open whenever the step is, whatever their length.
12
+ - An Assistant step's line shows its first line in plain words, open or folded, so "\*\*Inspecting alias settings\*\*" reads "Inspecting alias settings". Before, it showed the text only while folded, Markdown markers and all.
13
+ - While a prompt runs, **Steer** sits beside **Stop**, outlined, and the elapsed time follows it. Steer was plain accent text after the time, with a gap that changed as the time grew.
14
+
15
+ ### Fixed
16
+ - A tool's output in Working no longer shows terminal colour or hyperlink codes, in either layout. **Copy visible** and **Load** match what's shown; the saved Working keeps the codes.
17
+
7
18
  ## [0.11.3] — 2026-10-28
8
19
 
9
20
  ### Added
@@ -566,6 +566,8 @@
566
566
  // Where Studio last moved the Working pane itself (to the bottom, say). The scroll event that follows is Studio's,
567
567
  // not the person's, so it leaves the pause alone (Sol, c99).
568
568
  let traceOwnScrollTop = null;
569
+ // After Collapse all, steps that start later in the run arrive folded too, until Expand all (Oliver, 28 Oct).
570
+ let traceStepsFolded = false;
569
571
  let traceRenderRaf = null;
570
572
  const traceExpandedOutputs = new Set();
571
573
  const traceOpenDetails = new Set();
@@ -1074,6 +1076,16 @@
1074
1076
  return Math.max(0, Math.floor((compact.length * 3) / 4) - padding);
1075
1077
  }
1076
1078
 
1079
+ // Terminal colour and cursor codes in a tool's output (nvm, git, test runners) show as boxes on a page. Working shows
1080
+ // the text without them; the saved working keeps them. In order: an OSC sequence (a hyperlink or a title) through
1081
+ // its terminator, but never past the end of its line or the next ESC, so one cut off by a saved snapshot's omission
1082
+ // can't take the notice and the text after it (Sol, c100); a CSI code, as ansi-regex; what's left of one cut off
1083
+ // (at the end of a streamed update, say); a stray BEL (Oliver, 28 Oct).
1084
+ const TRACE_TERMINAL_CODE_RE = /\u001B\][^\u0007\u001B\u009C\n]*(?:\u0007|\u001B\\|\u009C)?|[\u001B\u009B][[\]()#;?]*(?:\d{1,4}(?:[;:]\d{0,4})*)?[\dA-PR-TZcf-nq-uy=><~]|[\u001B\u009B][[\]()#;?]*[\d;:]*|\u0007/g;
1085
+ function stripTraceTerminalCodes(text) {
1086
+ return String(text || "").replace(TRACE_TERMINAL_CODE_RE, "");
1087
+ }
1088
+
1077
1089
  function normalizeTraceEntry(entry, fallbackIndex) {
1078
1090
  if (!entry || typeof entry !== "object") return null;
1079
1091
  if (entry.type === "assistant") {
@@ -1097,7 +1109,7 @@
1097
1109
  label: parseNonEmptyString(entry.label),
1098
1110
  argsSummary: parseNonEmptyString(entry.argsSummary),
1099
1111
  args: parseNonEmptyString(entry.args),
1100
- output: typeof entry.output === "string" ? entry.output : "",
1112
+ output: typeof entry.output === "string" ? stripTraceTerminalCodes(entry.output) : "",
1101
1113
  images: Array.isArray(entry.images)
1102
1114
  ? entry.images.map((image, imageIndex) => normalizeTraceImage(image, imageIndex)).filter(Boolean)
1103
1115
  : [],
@@ -1147,6 +1159,7 @@
1147
1159
  traceSectionDefaults.clear();
1148
1160
  traceStepsShownOpen.clear();
1149
1161
  traceStepsPaused = false;
1162
+ traceStepsFolded = false;
1150
1163
  }
1151
1164
  renderTraceViewIfActive();
1152
1165
  }
@@ -4065,6 +4078,8 @@
4065
4078
  const actionsEl = makeStudioUiRefreshElement("div", "studio-refresh-toolbar-actions");
4066
4079
  const actionLineOneEl = makeStudioUiRefreshElement("div", "studio-refresh-action-line");
4067
4080
  if (!isEditorOnlyMode && sendRunBtn) actionLineOneEl.appendChild(sendRunBtn);
4081
+ // Steer sits beside Stop, and the clock follows it (Oliver, 28 Oct).
4082
+ if (!isEditorOnlyMode && queueSteerBtn) actionLineOneEl.appendChild(queueSteerBtn);
4068
4083
  const promptRunIndicator = makeStudioUiRefreshElement("span", "studio-prompt-run-indicator");
4069
4084
  promptRunIndicator.id = "studioPromptRunIndicator"; promptRunIndicator.hidden = true;
4070
4085
  promptRunIndicator.setAttribute("role", "status"); promptRunIndicator.setAttribute("aria-live", "polite");
@@ -4072,7 +4087,6 @@
4072
4087
  // The run status takes the indicator's place while running, so the row keeps its width.
4073
4088
  const runStatus = makeStudioUiRefreshElement("span", "studio-run-status");
4074
4089
  runStatus.hidden = true; actionLineOneEl.appendChild(runStatus);
4075
- if (!isEditorOnlyMode && queueSteerBtn) actionLineOneEl.appendChild(queueSteerBtn);
4076
4090
  const actionLineTwoEl = makeStudioUiRefreshElement("div", "studio-refresh-action-line studio-refresh-utility-action-line");
4077
4091
  if (!contextMenu && copyDraftBtn) actionLineTwoEl.appendChild(copyDraftBtn);
4078
4092
  if (!contextMenu && suggestCompletionBtn) actionLineTwoEl.appendChild(suggestCompletionBtn);
@@ -11884,7 +11898,11 @@
11884
11898
 
11885
11899
  function setTraceVisibleDetails(open) {
11886
11900
  if (rightView !== "trace" || studioLinkedReaderIsActive() || !critiqueViewEl) return false;
11887
- const nodes = critiqueViewEl.querySelectorAll("details[data-trace-details-key]");
11901
+ // In the new layout Collapse all folds the steps (and the prompt) to their lines and leaves what's inside them
11902
+ // as it was, so a step opened afterwards shows its sections. Expand all opens everything (Oliver, 28 Oct).
11903
+ const steps = Boolean(studioUiRefreshUi);
11904
+ const nodes = critiqueViewEl.querySelectorAll(steps && !open ? "details.trace-step[data-trace-details-key]" : "details[data-trace-details-key]");
11905
+ if (steps) traceStepsFolded = !open;
11888
11906
  for (const node of nodes) {
11889
11907
  const key = node.getAttribute("data-trace-details-key");
11890
11908
  if (open) { traceOpenDetails.add(key); traceClosedDetails.delete(key); }
@@ -13822,7 +13840,7 @@
13822
13840
  const visibleText = isExpanded || !preview.truncated ? value : preview.text;
13823
13841
  const code = options && options.language === "javascript";
13824
13842
  const rendered = code ? visibleText.replace(/\r\n/g, "\n").split("\n").map(line => highlightCodeLine(line, "javascript", "overlay")).join("\n") : escapeHtml(visibleText);
13825
- const body = "<pre class='plain-markdown trace-output" + (code ? " trace-output-code" : "") + "'>" + rendered + "</pre>";
13843
+ const body = "<pre class='plain-markdown trace-output" + (code ? " trace-output-code" : "") + (options && options.prose ? " trace-output-prose" : "") + "'>" + rendered + "</pre>";
13826
13844
  if (!preview.truncated) return body;
13827
13845
 
13828
13846
  const hiddenParts = [];
@@ -13858,7 +13876,9 @@
13858
13876
 
13859
13877
  function renderTraceSection(label, text, key, body, options) {
13860
13878
  const settings = options || {}, value = String(text || ""), images = settings.imageCount || 0;
13861
- const opened = traceSectionIsOpen(key, value, images > 1 ? false : undefined, !settings.pending || Boolean(value) || images > 0);
13879
+ // In the new layout a section is open whenever its step is, unless the person folds it (Oliver, 28 Oct).
13880
+ const opened = studioUiRefreshUi ? traceStepIsOpen(key, true)
13881
+ : traceSectionIsOpen(key, value, images > 1 ? false : undefined, !settings.pending || Boolean(value) || images > 0);
13862
13882
  const metrics = value ? formatTraceTextMetrics(value) : (images ? "" : (settings.pending ? "Waiting for output" : "No output"));
13863
13883
  const summary = [label, settings.isError ? "Error" : "", metrics, images ? images + " image" + (images === 1 ? "" : "s") : ""].filter(Boolean).join(" · ");
13864
13884
  return "<details class='trace-tool-details trace-section-fold" + (settings.isError ? " is-error" : "") + "' data-trace-details-key='" + escapeHtml(key)
@@ -14452,7 +14472,7 @@
14452
14472
  if (!steps) return "<article class='trace-card " + kindClass + "'><div class='trace-card-header'>" + header + "</div>" + body + "</article>";
14453
14473
  const key = "step:" + entry.id, running = entry.status === "streaming" || entry.status === "pending";
14454
14474
  // Earlier steps fold as new ones arrive, except while the person has scrolled up to read.
14455
- const opened = traceStepIsOpen(key, running || entry.id === latestId || (traceStepsPaused && traceStepsShownOpen.has(key)));
14475
+ const opened = traceStepIsOpen(key, !traceStepsFolded && (running || entry.id === latestId || (traceStepsPaused && traceStepsShownOpen.has(key))));
14456
14476
  shownOpen.set(key, opened);
14457
14477
  const firstLine = String(preview || "").split("\n").find(line => line.trim()) || "";
14458
14478
  return "<details class='trace-card " + kindClass + " trace-step' data-trace-details-key='" + escapeHtml(key) + "' data-trace-expected-open='" + opened + "'" + (opened ? " open" : "") + ">"
@@ -14466,23 +14486,25 @@
14466
14486
  const sections = [];
14467
14487
  if (String(entry.thinking || "").trim()) {
14468
14488
  sections.push(
14469
- renderTraceSection("Thinking", entry.thinking, entry.id + ":thinking", renderTraceOutput(entry.thinking, entry.id + ":thinking", { label: "Thinking" }))
14489
+ renderTraceSection("Thinking", entry.thinking, entry.id + ":thinking", renderTraceOutput(entry.thinking, entry.id + ":thinking", { label: "Thinking", prose: true }))
14470
14490
  );
14471
14491
  }
14472
14492
  if (filter === "all" && String(entry.text || "").trim()) {
14473
14493
  sections.push(
14474
- renderTraceSection("Response", entry.text, entry.id + ":response", renderTraceOutput(entry.text, entry.id + ":response", { label: "Response" }))
14494
+ renderTraceSection("Response", entry.text, entry.id + ":response", renderTraceOutput(entry.text, entry.id + ":response", { label: "Response", prose: true }))
14475
14495
  );
14476
14496
  }
14477
14497
  if (!sections.length) {
14478
14498
  sections.push("<div class='trace-empty-inline'>Waiting for streamed content…</div>");
14479
14499
  }
14500
+ const title = steps ? plainTraceTitle((filter === "thinking" ? entry.thinking : (entry.text || entry.thinking)) || "") : "";
14480
14501
  return card("trace-card-assistant", entry,
14481
14502
  "<span class='trace-kind-badge'>" + escapeHtml(filter === "thinking" ? "Thinking" : "Assistant") + "</span>"
14503
+ + (title ? "<span class='trace-card-title'>" + escapeHtml(title) + "</span>" : "")
14482
14504
  + "<span class='trace-card-meta'>" + escapeHtml(formatReferenceTime(entry.updatedAt) || "live") + "</span>"
14483
14505
  + renderTraceEntryStatus(state, entry.status, false)
14484
14506
  + (entry.stopReason === "length" ? "<span class='trace-card-meta'>Cut off at the length limit</span>" : ""),
14485
- sections.join(""), filter === "thinking" ? entry.thinking : (entry.text || entry.thinking));
14507
+ sections.join(""), "");
14486
14508
  }
14487
14509
 
14488
14510
  const title = entry.label || entry.toolName || "tool";
@@ -14509,6 +14531,21 @@
14509
14531
  return "<div class='trace-panel'>" + toolbar + "<div class='trace-list'>" + promptCard + cards + "</div></div>";
14510
14532
  }
14511
14533
 
14534
+ // A line of Markdown as plain words for a step's title: "**Inspecting alias settings**" reads "Inspecting alias
14535
+ // settings". Code spans keep their text as written, and underscores are left alone, as in __init__ (Astra, c100).
14536
+ function plainTraceTitle(text) {
14537
+ const line = String(text || "").split("\n").find(part => part.trim()) || "";
14538
+ const parts = line.trim().replace(/^(?:#{1,6}\s+|>\s*|[-*+]\s+|\d+[.)]\s+)+/, "").split(/(`[^`]*`)/);
14539
+ const last = parts.length - 1;
14540
+ return parts.map((part, index) => {
14541
+ if (index % 2) return part.slice(1, -1);
14542
+ let plain = part.replace(/\[([^\]]*)\]\([^)]*\)/g, "$1").replace(/\*\*(.+?)\*\*/g, "$1");
14543
+ if (index === 0) plain = plain.replace(/^\*\*/, "");
14544
+ if (index === last) plain = plain.replace(/\*\*$/, "");
14545
+ return plain;
14546
+ }).join("").trim().slice(0, 300);
14547
+ }
14548
+
14512
14549
  // A step is open while it runs or is the latest, unless the person chose otherwise; earlier steps fold to one line.
14513
14550
  function traceStepIsOpen(key, byDefault) {
14514
14551
  if (traceOpenDetails.has(key)) return true;
@@ -18806,7 +18843,7 @@
18806
18843
  if (openCompanionBtn) addItem(loadMenu, openCompanionBtn, "studioNewDocumentWindowInfo", openCompanionBtn.title);
18807
18844
  }
18808
18845
  studioUiRefreshUi.menus = studioUiRefreshUi.menus.filter(item => item !== studioUiRefreshUi.openMenu);
18809
- studioUiRefreshUi.actionLine.insertBefore(addMenu.anchor, queueSteerBtn?.nextSibling || sendRunBtn?.nextSibling || null);
18846
+ studioUiRefreshUi.actionLine.insertBefore(addMenu.anchor, studioUiRefreshUi.runStatus?.nextSibling || null);
18810
18847
  // One click (Oliver, 9 Oct): the real guarded buttons sit in the row and only the one that
18811
18848
  // applies shows, "Add selection to Prompt" with text selected, else "Add document to Prompt".
18812
18849
  addMenu.button.hidden = true;
package/client/studio.css CHANGED
@@ -6810,11 +6810,11 @@
6810
6810
  min-width: 8.6rem;
6811
6811
  }
6812
6812
 
6813
- /* Stop is the one filled action while running; steering stays plain. */
6813
+ /* Stop is the one filled action while running; Steer beside it is outlined (Oliver, 28 Oct). */
6814
6814
  body.studio-ui-refresh #queueSteerBtn:not(:disabled) {
6815
6815
  background: transparent;
6816
- border-color: transparent;
6817
- color: var(--accent);
6816
+ border-color: var(--control-border);
6817
+ color: var(--text);
6818
6818
  font-weight: 600;
6819
6819
  }
6820
6820
 
@@ -6822,7 +6822,7 @@
6822
6822
  background: var(--studio-header-action-hover-bg, var(--panel-2));
6823
6823
  }
6824
6824
 
6825
- /* Plain text needs no button width. The old 10rem left a gap before it and, on a
6825
+ /* Steer needs no fixed width. The old 10rem left a gap before it and, on a
6826
6826
  13-inch screen, pushed the tools onto a second row while running (Oliver, 19 Oct). */
6827
6827
  body.studio-ui-refresh #queueSteerBtn {
6828
6828
  min-width: 0;
@@ -7676,7 +7676,7 @@
7676
7676
  body.studio-workspace-layout .repl-journal-chip { border-radius: 0; padding-left: 0; padding-right: 0; }
7677
7677
  body.studio-workspace-layout .trace-summary-badge { color: var(--text); font-size: 13px; font-weight: 700; }
7678
7678
  /* Oliver, 27 Oct: Working like agent-markdown-preview's page. The prompt and each step are one line until opened;
7679
- inside a step, Code and Output are plain sections, and only the content keeps its frame. */
7679
+ inside a step, Code and Output are plain sections. */
7680
7680
  body.studio-workspace-layout details.trace-step { display: block; padding: 0; }
7681
7681
  body.studio-workspace-layout details.trace-step > summary.trace-card-header {
7682
7682
  list-style: none; cursor: pointer; user-select: none; flex-wrap: nowrap; padding: 8px 11px;
@@ -7704,6 +7704,24 @@
7704
7704
  max-height: 40vh; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere;
7705
7705
  color: var(--text); font-size: var(--studio-working-font-size); line-height: 1.45;
7706
7706
  }
7707
+ /* Oliver, 28 Oct: lit like agent-markdown-preview's Working page. Steps are the light surface on the pane's darker
7708
+ one, an open step has a rule under its line, and inside a step the text sits on the step without frames of its
7709
+ own. The prompt, Thinking and Response read as prose; an Assistant step's title is its first line, so it isn't
7710
+ bold like a tool's label. */
7711
+ body.studio-workspace-layout #critiqueView:has(> .trace-panel) { background: var(--bg); }
7712
+ body.studio-workspace-layout details.trace-step { border-color: var(--panel-border); background: var(--panel); box-shadow: none; }
7713
+ body.studio-workspace-layout details.trace-step > summary.trace-card-header { padding: 9px 14px; }
7714
+ body.studio-workspace-layout details.trace-step > .trace-step-body { gap: 4px; border-top: 1px solid var(--panel-border); padding: 8px 14px 10px; }
7715
+ body.studio-workspace-layout .trace-step .trace-output-wrap,
7716
+ body.studio-workspace-layout .trace-step .trace-output,
7717
+ body.studio-workspace-layout .trace-step .trace-tool-fields,
7718
+ body.studio-workspace-layout .trace-step .trace-image-gallery { border: 0; border-radius: 0; background: transparent; padding-left: 0; padding-right: 0; }
7719
+ body.studio-workspace-layout .trace-step .trace-output { margin: 0; padding-top: 2px; padding-bottom: 4px; }
7720
+ body.studio-workspace-layout .trace-step .trace-output-prose,
7721
+ body.studio-workspace-layout .trace-prompt-text { font-family: inherit; line-height: 1.5; }
7722
+ body.studio-workspace-layout .trace-card-assistant > summary > .trace-card-title { font-weight: 400; }
7723
+ body.studio-workspace-layout .trace-step code.trace-tool-field-value { padding: 0; border: 0; background: transparent; }
7724
+ body.studio-workspace-layout .trace-step .trace-output-truncation { padding: 4px 0; background: transparent; }
7707
7725
  body.studio-workspace-layout .trace-filter-btn.is-active { color: var(--accent); }
7708
7726
  body.studio-workspace-layout #scratchpadBtn.has-content:not(:disabled):hover,
7709
7727
  body.studio-workspace-layout #reviewNotesBtn.has-content:not(:disabled):hover,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-studio",
3
- "version": "0.11.3",
3
+ "version": "0.11.4",
4
4
  "description": "Two-pane browser workspace for pi with prompt/response editing, annotations, critiques, active quiz, prompt/response history, live previews, and tmux-backed REPL/literate REPL workflows",
5
5
  "type": "module",
6
6
  "license": "MIT",