pi-studio 0.9.8 → 0.9.9
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 +5 -0
- package/client/studio-client.js +13 -10
- package/index.ts +7 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,11 @@ All notable changes to `pi-studio` are documented here.
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [0.9.9] — 2026-05-19
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
- In SSH-launched Studio sessions, copy actions now use the local browser clipboard instead of writing to the remote host clipboard.
|
|
11
|
+
|
|
7
12
|
## [0.9.8] — 2026-05-19
|
|
8
13
|
|
|
9
14
|
### Fixed
|
package/client/studio-client.js
CHANGED
|
@@ -156,6 +156,7 @@
|
|
|
156
156
|
? "editor-only"
|
|
157
157
|
: "full";
|
|
158
158
|
const isEditorOnlyMode = studioMode === "editor-only";
|
|
159
|
+
const isSshStudioSession = Boolean(document.body && document.body.dataset && document.body.dataset.sshSession === "1");
|
|
159
160
|
|
|
160
161
|
const initialQueryParams = new URLSearchParams(window.location.search || "");
|
|
161
162
|
const explicitDocumentIdentityFromUrl = initialQueryParams.has("docId")
|
|
@@ -846,16 +847,18 @@
|
|
|
846
847
|
async function writeTextToClipboard(text) {
|
|
847
848
|
const content = String(text || "");
|
|
848
849
|
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
850
|
+
if (!isSshStudioSession) {
|
|
851
|
+
try {
|
|
852
|
+
await fetchStudioJson("/clipboard", {
|
|
853
|
+
method: "POST",
|
|
854
|
+
body: JSON.stringify({ text: content }),
|
|
855
|
+
});
|
|
856
|
+
return true;
|
|
857
|
+
} catch {
|
|
858
|
+
// Fall back to browser clipboard APIs. The server-side clipboard path
|
|
859
|
+
// is most reliable for local Studio, but may be unavailable on systems
|
|
860
|
+
// without a clipboard command.
|
|
861
|
+
}
|
|
859
862
|
}
|
|
860
863
|
|
|
861
864
|
// Prefer a copy-event payload first. It runs synchronously inside the
|
package/index.ts
CHANGED
|
@@ -8646,6 +8646,7 @@ function buildStudioHtml(
|
|
|
8646
8646
|
const clientScriptHref = `/studio-client.js?token=${encodeURIComponent(studioToken ?? "")}`;
|
|
8647
8647
|
const faviconHref = buildStudioFaviconDataUri(style);
|
|
8648
8648
|
const bootConfigJson = JSON.stringify({ mermaidConfig }).replace(/</g, "\\u003c");
|
|
8649
|
+
const initialSshSession = isSshSession() ? "1" : "0";
|
|
8649
8650
|
const isEditorOnlyMode = studioMode === "editor-only";
|
|
8650
8651
|
const appTitle = isEditorOnlyMode ? "π Studio — Editor" : "π Studio";
|
|
8651
8652
|
const appSubtitle = isEditorOnlyMode ? "Editor Workspace" : "Editor & Response Workspace";
|
|
@@ -8664,7 +8665,7 @@ ${cssVarsBlock}
|
|
|
8664
8665
|
</style>
|
|
8665
8666
|
<link rel="stylesheet" href="${stylesheetHref}" />
|
|
8666
8667
|
</head>
|
|
8667
|
-
<body data-initial-source="${initialSource}" data-initial-label="${initialLabel}" data-initial-path="${initialPath}" data-initial-draft-id="${initialDraftId}" data-initial-resource-dir="${initialResourceDir}" data-model-label="${initialModel}" data-terminal-label="${initialTerminal}" data-terminal-detail="${initialTerminalDetailAttr}" data-context-tokens="${initialContextTokens}" data-context-window="${initialContextWindow}" data-context-percent="${initialContextPercent}" data-studio-mode="${studioMode}">
|
|
8668
|
+
<body data-initial-source="${initialSource}" data-initial-label="${initialLabel}" data-initial-path="${initialPath}" data-initial-draft-id="${initialDraftId}" data-initial-resource-dir="${initialResourceDir}" data-model-label="${initialModel}" data-terminal-label="${initialTerminal}" data-terminal-detail="${initialTerminalDetailAttr}" data-context-tokens="${initialContextTokens}" data-context-window="${initialContextWindow}" data-context-percent="${initialContextPercent}" data-studio-mode="${studioMode}" data-ssh-session="${initialSshSession}">
|
|
8668
8669
|
<header>
|
|
8669
8670
|
<h1><span class="app-logo" aria-hidden="true">π</span> Studio <span class="app-subtitle">${appSubtitle}</span></h1>
|
|
8670
8671
|
<div class="controls">
|
|
@@ -11302,6 +11303,11 @@ export default function (pi: ExtensionAPI) {
|
|
|
11302
11303
|
return;
|
|
11303
11304
|
}
|
|
11304
11305
|
|
|
11306
|
+
if (isSshSession()) {
|
|
11307
|
+
respondJson(res, 409, { ok: false, error: "Server clipboard is disabled for SSH Studio sessions; use the browser clipboard." });
|
|
11308
|
+
return;
|
|
11309
|
+
}
|
|
11310
|
+
|
|
11305
11311
|
const result = await writeStudioSystemClipboard(text);
|
|
11306
11312
|
if (result.ok) {
|
|
11307
11313
|
respondJson(res, 200, { ok: true, method: result.method });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-studio",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.9",
|
|
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",
|