pi-studio 0.11.5 → 0.11.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.
- package/CHANGELOG.md +10 -0
- package/client/studio-client.js +76 -25
- package/client/studio.css +3 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,16 @@ All notable changes to `pi-studio` are documented here.
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [0.11.6] — 2026-10-30
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
- **Messages**, a filter in Working, shows the prompt, what Pi wrote along the way and the steers, without thinking or tools. Steps keep their numbers from the whole run, and **Copy visible** copies just those.
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
- In the new layout, an Assistant step's line shows its first line whether the step is open or folded, so you can tell what it said whatever is folded inside it. In 0.11.5 it showed only while the step was folded. The prompt and a steer still hide theirs when open, since their text sits right under the line.
|
|
14
|
+
- In the new layout, Working has one **Expand all** / **Collapse all** button, labelled with what a click does, as in agent-markdown-preview. Expand all now holds for the rest of the run, as Collapse all already did: steps that start later arrive open, until Collapse all. Ctrl+Shift+] and Ctrl+Shift+[ are unchanged.
|
|
15
|
+
- In the new layout, Working's row has **Copy visible** and no **Load visible into editor**, so it fits on one line beside the editor; copy and paste does the same. The classic layout keeps Load.
|
|
16
|
+
|
|
7
17
|
## [0.11.5] — 2026-10-29
|
|
8
18
|
|
|
9
19
|
### Added
|
package/client/studio-client.js
CHANGED
|
@@ -568,8 +568,10 @@
|
|
|
568
568
|
// Where Studio last moved the Working pane itself (to the bottom, say). The scroll event that follows is Studio's,
|
|
569
569
|
// not the person's, so it leaves the pause alone (Sol, c99).
|
|
570
570
|
let traceOwnScrollTop = null;
|
|
571
|
-
// After Collapse all, steps that start later in the run arrive folded too, until Expand all (Oliver, 28 Oct)
|
|
571
|
+
// After Collapse all, steps that start later in the run arrive folded too, until Expand all (Oliver, 28 Oct); after
|
|
572
|
+
// Expand all they arrive open, until Collapse all, as in agent-markdown-preview (Oliver, 29 Oct).
|
|
572
573
|
let traceStepsFolded = false;
|
|
574
|
+
let traceStepsExpanded = false;
|
|
573
575
|
let traceRenderRaf = null;
|
|
574
576
|
const traceExpandedOutputs = new Set();
|
|
575
577
|
const traceOpenDetails = new Set();
|
|
@@ -1171,6 +1173,7 @@
|
|
|
1171
1173
|
traceStepsShownOpen.clear();
|
|
1172
1174
|
traceStepsPaused = false;
|
|
1173
1175
|
traceStepsFolded = false;
|
|
1176
|
+
traceStepsExpanded = false;
|
|
1174
1177
|
}
|
|
1175
1178
|
renderTraceViewIfActive();
|
|
1176
1179
|
}
|
|
@@ -1340,7 +1343,7 @@
|
|
|
1340
1343
|
}
|
|
1341
1344
|
|
|
1342
1345
|
function normalizeTraceFilter(filter) {
|
|
1343
|
-
return filter === "thinking" || filter === "tools" ? filter : "all";
|
|
1346
|
+
return filter === "messages" || filter === "thinking" || filter === "tools" ? filter : "all";
|
|
1344
1347
|
}
|
|
1345
1348
|
|
|
1346
1349
|
function setTraceFilter(nextFilter) {
|
|
@@ -1361,6 +1364,10 @@
|
|
|
1361
1364
|
if (filter === "thinking") {
|
|
1362
1365
|
return entries.filter((entry) => entry.type === "assistant" && String(entry.thinking || "").trim());
|
|
1363
1366
|
}
|
|
1367
|
+
// What Pi wrote along the way, and the steers, without thinking or tools (Oliver, 29 Oct).
|
|
1368
|
+
if (filter === "messages") {
|
|
1369
|
+
return entries.filter((entry) => (entry.type === "assistant" || entry.type === "steer") && String(entry.text || "").trim());
|
|
1370
|
+
}
|
|
1364
1371
|
return entries.filter((entry) => {
|
|
1365
1372
|
if (entry.type === "assistant") {
|
|
1366
1373
|
return Boolean(String(entry.thinking || "").trim() || String(entry.text || "").trim());
|
|
@@ -1406,6 +1413,10 @@
|
|
|
1406
1413
|
.join("\n\n");
|
|
1407
1414
|
}
|
|
1408
1415
|
|
|
1416
|
+
if (filter === "messages") {
|
|
1417
|
+
return entries.map((entry) => (entry.type === "steer" ? "Steer:\n" : "Assistant:\n") + String(entry.text || "").trim()).join("\n\n---\n\n");
|
|
1418
|
+
}
|
|
1419
|
+
|
|
1409
1420
|
return entries.map((entry) => {
|
|
1410
1421
|
if (entry.type === "assistant") {
|
|
1411
1422
|
const parts = [];
|
|
@@ -1442,6 +1453,7 @@
|
|
|
1442
1453
|
|
|
1443
1454
|
function getWorkingDocumentLabel(filterOverride) {
|
|
1444
1455
|
const filter = normalizeTraceFilter(filterOverride || traceFilter);
|
|
1456
|
+
if (filter === "messages") return "working (messages)";
|
|
1445
1457
|
if (filter === "thinking") return "working (thinking)";
|
|
1446
1458
|
if (filter === "tools") return "working (tools)";
|
|
1447
1459
|
return "working";
|
|
@@ -11888,6 +11900,7 @@
|
|
|
11888
11900
|
|| !target.matches("details[data-trace-details-key]")) return;
|
|
11889
11901
|
const key = target.getAttribute("data-trace-details-key") || "";
|
|
11890
11902
|
if (!key) return;
|
|
11903
|
+
syncTraceBulkToggle();
|
|
11891
11904
|
const expected = target.getAttribute("data-trace-expected-open");
|
|
11892
11905
|
// Initial open attributes also queue native toggles: not user choices.
|
|
11893
11906
|
if (expected !== null && expected === String(target.open) && target.getAttribute("data-trace-user-toggle") !== "1") return;
|
|
@@ -11904,7 +11917,7 @@
|
|
|
11904
11917
|
// as it was, so a step opened afterwards shows its sections. Expand all opens everything (Oliver, 28 Oct).
|
|
11905
11918
|
const steps = Boolean(studioUiRefreshUi);
|
|
11906
11919
|
const nodes = critiqueViewEl.querySelectorAll(steps && !open ? "details.trace-step[data-trace-details-key]" : "details[data-trace-details-key]");
|
|
11907
|
-
if (steps) traceStepsFolded = !open;
|
|
11920
|
+
if (steps) { traceStepsFolded = !open; traceStepsExpanded = open; }
|
|
11908
11921
|
for (const node of nodes) {
|
|
11909
11922
|
const key = node.getAttribute("data-trace-details-key");
|
|
11910
11923
|
if (open) { traceOpenDetails.add(key); traceClosedDetails.delete(key); }
|
|
@@ -11923,9 +11936,30 @@
|
|
|
11923
11936
|
fold?.querySelector(":scope > summary")?.focus({ preventScroll: true });
|
|
11924
11937
|
}
|
|
11925
11938
|
if (nodes.length) traceAutoScroll = false;
|
|
11939
|
+
syncTraceBulkToggle();
|
|
11926
11940
|
return nodes.length > 0;
|
|
11927
11941
|
}
|
|
11928
11942
|
|
|
11943
|
+
// In the new layout one button folds or opens every step, labelled with what a click does: Collapse all only when every
|
|
11944
|
+
// step shown is open, as in agent-markdown-preview (Oliver, 29 Oct). The classic layout keeps its two buttons.
|
|
11945
|
+
function getTraceBulkToggle(allOpen) {
|
|
11946
|
+
return allOpen
|
|
11947
|
+
? { action: "collapse", label: "Collapse all", keys: "Control+Shift+[", title: "Fold every step; later steps arrive folded, until Expand all (Ctrl+Shift+[ while focused here)" }
|
|
11948
|
+
: { action: "expand", label: "Expand all", keys: "Control+Shift+]", title: "Open every step; later steps arrive open, until Collapse all (Ctrl+Shift+] while focused here)" };
|
|
11949
|
+
}
|
|
11950
|
+
|
|
11951
|
+
function syncTraceBulkToggle() {
|
|
11952
|
+
const button = studioUiRefreshUi && critiqueViewEl ? critiqueViewEl.querySelector("[data-trace-bulk]") : null;
|
|
11953
|
+
if (!button) return;
|
|
11954
|
+
const steps = Array.from(critiqueViewEl.querySelectorAll("details.trace-step[data-trace-details-key]"));
|
|
11955
|
+
const toggle = getTraceBulkToggle(steps.length > 0 && steps.every((step) => step.open));
|
|
11956
|
+
if (button.getAttribute("data-trace-action") === toggle.action) return;
|
|
11957
|
+
button.setAttribute("data-trace-action", toggle.action);
|
|
11958
|
+
button.setAttribute("aria-keyshortcuts", toggle.keys);
|
|
11959
|
+
button.title = toggle.title;
|
|
11960
|
+
button.textContent = toggle.label;
|
|
11961
|
+
}
|
|
11962
|
+
|
|
11929
11963
|
function handleTracePaneKeydown(event) {
|
|
11930
11964
|
if (!event || event.defaultPrevented || event.repeat || event.isComposing || rightView !== "trace" || studioLinkedReaderIsActive()
|
|
11931
11965
|
|| studioModalBlocksDraftAction() || !event.ctrlKey || !event.shiftKey || event.metaKey || event.altKey
|
|
@@ -14423,9 +14457,9 @@
|
|
|
14423
14457
|
: (context.mode === "missing"
|
|
14424
14458
|
? "Not saved"
|
|
14425
14459
|
: (TRACE_RUN_STATUS_LABELS[state.status] || "Idle")));
|
|
14426
|
-
const filterMeta = filter === "
|
|
14427
|
-
? "
|
|
14428
|
-
: (filter === "tools" ? "Tools only" : null);
|
|
14460
|
+
const filterMeta = filter === "messages"
|
|
14461
|
+
? "Messages only"
|
|
14462
|
+
: (filter === "thinking" ? "Thinking only" : (filter === "tools" ? "Tools only" : null));
|
|
14429
14463
|
const historyMeta = (context.mode === "history" || context.mode === "missing" || context.mode === "loading")
|
|
14430
14464
|
? getTraceHistoryContextLabel()
|
|
14431
14465
|
: null;
|
|
@@ -14433,7 +14467,7 @@
|
|
|
14433
14467
|
// step is one numbered line until opened, and this header is the one line saying the run's state (the pane is
|
|
14434
14468
|
// already called Working).
|
|
14435
14469
|
const steps = Boolean(studioUiRefreshUi);
|
|
14436
|
-
const toolbar = "<div class='trace-toolbar'>"
|
|
14470
|
+
const toolbar = (allOpen) => "<div class='trace-toolbar'>"
|
|
14437
14471
|
+ "<div class='trace-summary'>"
|
|
14438
14472
|
+ (steps ? "" : "<span class='trace-summary-badge'>Working</span>")
|
|
14439
14473
|
+ "<span class='trace-summary-status trace-status-" + escapeHtml(String(state.status || "idle")) + "'>" + escapeHtml(statusLabel) + "</span>"
|
|
@@ -14446,12 +14480,15 @@
|
|
|
14446
14480
|
+ "<div class='trace-controls'>"
|
|
14447
14481
|
+ "<div class='trace-filter-group' role='tablist' aria-label='Working components'>"
|
|
14448
14482
|
+ "<button type='button' class='trace-filter-btn" + (filter === "all" ? " is-active" : "") + "' data-trace-filter='all' aria-pressed='" + (filter === "all" ? "true" : "false") + "'>All</button>"
|
|
14483
|
+
+ "<button type='button' class='trace-filter-btn" + (filter === "messages" ? " is-active" : "") + "' data-trace-filter='messages' aria-pressed='" + (filter === "messages" ? "true" : "false") + "'>Messages</button>"
|
|
14449
14484
|
+ "<button type='button' class='trace-filter-btn" + (filter === "thinking" ? " is-active" : "") + "' data-trace-filter='thinking' aria-pressed='" + (filter === "thinking" ? "true" : "false") + "'>Thinking</button>"
|
|
14450
14485
|
+ "<button type='button' class='trace-filter-btn" + (filter === "tools" ? " is-active" : "") + "' data-trace-filter='tools' aria-pressed='" + (filter === "tools" ? "true" : "false") + "'>Tools</button>"
|
|
14451
14486
|
+ "</div>"
|
|
14452
|
-
+
|
|
14453
|
-
|
|
14454
|
-
|
|
14487
|
+
+ (steps ? renderTraceBulkToggle(getTraceBulkToggle(allOpen), entries.length > 0)
|
|
14488
|
+
: "<button type='button' class='trace-action-btn' data-trace-action='collapse' aria-keyshortcuts='Control+Shift+[' title='Collapse displayed Working sections (Ctrl+Shift+[ while focused here)'" + (entries.length ? "" : " disabled") + ">Collapse all</button>"
|
|
14489
|
+
+ "<button type='button' class='trace-action-btn' data-trace-action='expand' aria-keyshortcuts='Control+Shift+]' title='Expand displayed Working sections (Ctrl+Shift+] while focused here); full output stays a separate choice'" + (entries.length ? "" : " disabled") + ">Expand all</button>")
|
|
14490
|
+
// The new layout has Copy only, so the row stays one line beside the editor; paste does what Load did (Oliver, 29 Oct).
|
|
14491
|
+
+ (steps ? "" : "<button type='button' class='trace-action-btn' data-trace-action='load'" + (hasVisibleContent ? "" : " disabled") + ">Load visible into editor</button>")
|
|
14455
14492
|
+ "<button type='button' class='trace-action-btn' data-trace-action='copy'" + (hasVisibleContent ? "" : " disabled") + ">Copy visible</button>"
|
|
14456
14493
|
+ "</div>"
|
|
14457
14494
|
+ "</div>";
|
|
@@ -14462,14 +14499,16 @@
|
|
|
14462
14499
|
? "Loading saved working for this response…"
|
|
14463
14500
|
: (context.mode === "missing"
|
|
14464
14501
|
? "No working was saved for this response."
|
|
14465
|
-
: (filter === "
|
|
14466
|
-
? "No
|
|
14467
|
-
: (filter === "
|
|
14468
|
-
? "No
|
|
14469
|
-
: (
|
|
14470
|
-
? "
|
|
14471
|
-
:
|
|
14472
|
-
|
|
14502
|
+
: (filter === "messages"
|
|
14503
|
+
? "No messages in this working view yet."
|
|
14504
|
+
: (filter === "thinking"
|
|
14505
|
+
? "No thinking steps in this working view yet."
|
|
14506
|
+
: (filter === "tools"
|
|
14507
|
+
? "No tool steps in this working view yet."
|
|
14508
|
+
: (state.status === "running"
|
|
14509
|
+
? "Waiting for the first model or tool update…"
|
|
14510
|
+
: "No live working view yet. Start a run or critique to watch working details here.")))));
|
|
14511
|
+
return "<div class='trace-panel'>" + toolbar(false) + (promptCard ? "<div class='trace-list'>" + promptCard + "</div>" : "")
|
|
14473
14512
|
+ "<div class='trace-empty'>" + escapeHtml(emptyMessage) + "</div></div>";
|
|
14474
14513
|
}
|
|
14475
14514
|
|
|
@@ -14477,14 +14516,15 @@
|
|
|
14477
14516
|
const positions = new Map(getTraceEntriesForFilter("all").map((entry, index) => [entry.id, index + 1]));
|
|
14478
14517
|
const latestId = entries[entries.length - 1].id, shownOpen = new Map();
|
|
14479
14518
|
// Oliver, 29 Oct (option C): a step's line is its number, its kind, what a tool acted on, and its time on the right,
|
|
14480
|
-
// as on agent-markdown-preview's page.
|
|
14519
|
+
// as on agent-markdown-preview's page. An Assistant step's line adds its first line, muted, open or folded; the prompt's
|
|
14520
|
+
// and a steer's add theirs while folded.
|
|
14481
14521
|
const card = (kindClass, entry, line, body, options) => {
|
|
14482
14522
|
const settings = options || {};
|
|
14483
14523
|
if (!steps) return "<article class='trace-card " + kindClass + "'><div class='trace-card-header'>" + line.classic + "</div>" + body + "</article>";
|
|
14484
14524
|
const key = "step:" + entry.id, running = entry.status === "streaming" || entry.status === "pending";
|
|
14485
14525
|
// Earlier steps fold as new ones arrive, except while the person has scrolled up to read. A steer, like the
|
|
14486
14526
|
// prompt, is open when short.
|
|
14487
|
-
const opened = traceStepIsOpen(key, !traceStepsFolded && (typeof settings.openByDefault === "boolean" ? settings.openByDefault
|
|
14527
|
+
const opened = traceStepIsOpen(key, traceStepsExpanded || !traceStepsFolded && (typeof settings.openByDefault === "boolean" ? settings.openByDefault
|
|
14488
14528
|
: (running || entry.id === latestId || (traceStepsPaused && traceStepsShownOpen.has(key)))));
|
|
14489
14529
|
shownOpen.set(key, opened);
|
|
14490
14530
|
const preview = String(settings.preview || "").split("\n").find(part => part.trim()) || "";
|
|
@@ -14500,12 +14540,12 @@
|
|
|
14500
14540
|
const cards = entries.map((entry) => {
|
|
14501
14541
|
if (entry.type === "assistant") {
|
|
14502
14542
|
const sections = [];
|
|
14503
|
-
if (String(entry.thinking || "").trim()) {
|
|
14543
|
+
if (filter !== "messages" && String(entry.thinking || "").trim()) {
|
|
14504
14544
|
sections.push(
|
|
14505
14545
|
renderTraceSection("Thinking", entry.thinking, entry.id + ":thinking", renderTraceOutput(entry.thinking, entry.id + ":thinking", { label: "Thinking", prose: true, headings: steps }))
|
|
14506
14546
|
);
|
|
14507
14547
|
}
|
|
14508
|
-
if (filter === "all" && String(entry.text || "").trim()) {
|
|
14548
|
+
if ((filter === "all" || filter === "messages") && String(entry.text || "").trim()) {
|
|
14509
14549
|
sections.push(
|
|
14510
14550
|
renderTraceSection("Response", entry.text, entry.id + ":response", renderTraceOutput(entry.text, entry.id + ":response", { label: "Response", prose: true }))
|
|
14511
14551
|
);
|
|
@@ -14550,7 +14590,13 @@
|
|
|
14550
14590
|
// Only the steps shown now: one hidden by a filter keeps its state, so a filter round trip folds nothing (Astra).
|
|
14551
14591
|
for (const [key, opened] of shownOpen) { if (opened) traceStepsShownOpen.add(key); else traceStepsShownOpen.delete(key); }
|
|
14552
14592
|
|
|
14553
|
-
|
|
14593
|
+
const allOpen = (!promptCard || tracePromptCardIsOpen(state)) && Array.from(shownOpen.values()).every(Boolean);
|
|
14594
|
+
return "<div class='trace-panel'>" + toolbar(allOpen) + "<div class='trace-list'>" + promptCard + cards + "</div></div>";
|
|
14595
|
+
}
|
|
14596
|
+
|
|
14597
|
+
function renderTraceBulkToggle(toggle, enabled) {
|
|
14598
|
+
return "<button type='button' class='trace-action-btn' data-trace-bulk data-trace-action='" + toggle.action + "' aria-keyshortcuts='" + toggle.keys
|
|
14599
|
+
+ "' title='" + escapeHtml(toggle.title) + "'" + (enabled ? "" : " disabled") + ">" + toggle.label + "</button>";
|
|
14554
14600
|
}
|
|
14555
14601
|
|
|
14556
14602
|
// What a tool step acted on, for its line: the file's name for read, write and edit, otherwise its activity label,
|
|
@@ -14585,10 +14631,15 @@
|
|
|
14585
14631
|
}
|
|
14586
14632
|
|
|
14587
14633
|
// What Pi is responding to: open when short, otherwise one line with its start, like a long section.
|
|
14634
|
+
function tracePromptCardIsOpen(state) {
|
|
14635
|
+
const text = String(state.prompt || "");
|
|
14636
|
+
const short = text.length <= TRACE_SECTION_AUTO_OPEN_MAX_CHARS && countTraceTextLines(text) <= TRACE_SECTION_AUTO_OPEN_MAX_LINES;
|
|
14637
|
+
return traceStepIsOpen("prompt:" + (state.runId || "live"), short);
|
|
14638
|
+
}
|
|
14639
|
+
|
|
14588
14640
|
function renderTracePromptCard(state) {
|
|
14589
14641
|
const text = String(state.prompt || ""), key = "prompt:" + (state.runId || "live");
|
|
14590
|
-
const
|
|
14591
|
-
const opened = traceStepIsOpen(key, short);
|
|
14642
|
+
const opened = tracePromptCardIsOpen(state);
|
|
14592
14643
|
const firstLine = text.split("\n").find(line => line.trim()) || "", time = formatReferenceTime(state.startedAt);
|
|
14593
14644
|
return "<details class='trace-card trace-card-prompt trace-step' data-trace-details-key='" + escapeHtml(key) + "' data-trace-expected-open='" + opened + "'" + (opened ? " open" : "") + ">"
|
|
14594
14645
|
+ "<summary class='trace-card-header'><span class='trace-card-title'>Prompt</span>"
|
package/client/studio.css
CHANGED
|
@@ -7687,7 +7687,9 @@
|
|
|
7687
7687
|
body.studio-workspace-layout details.trace-step > summary > .trace-step-preview {
|
|
7688
7688
|
flex: 1 1 6em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12px;
|
|
7689
7689
|
}
|
|
7690
|
-
|
|
7690
|
+
/* An Assistant step's line always has its first line, open or folded, whatever is folded inside it (Oliver, 29 Oct). The
|
|
7691
|
+
prompt's and a steer's text sits right under their line when open, so they hide it then. */
|
|
7692
|
+
body.studio-workspace-layout details.trace-step[open]:not(.trace-card-assistant) > summary > .trace-step-preview { display: none; }
|
|
7691
7693
|
body.studio-workspace-layout .trace-step-body { display: flex; flex-direction: column; gap: 6px; padding: 0 11px 10px; }
|
|
7692
7694
|
body.studio-workspace-layout .trace-step .trace-tool-details { border: 0; border-radius: 0; background: transparent; overflow: visible; }
|
|
7693
7695
|
body.studio-workspace-layout .trace-step .trace-tool-details > summary { padding: 3px 0; }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-studio",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.6",
|
|
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",
|