@oversk7/pi-web-dsh-style 1.0.1 → 1.1.1
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/README.md +21 -0
- package/THIRD_PARTY_NOTICES.md +4 -0
- package/attachment-parser.ts +210 -0
- package/attachment-store.ts +67 -24
- package/background-jobs.ts +52 -0
- package/extension-settings.ts +50 -0
- package/file-preview.ts +7 -1
- package/package.json +21 -3
- package/pi-rpc.ts +7 -5
- package/server.ts +251 -83
- package/sse-channel.ts +37 -0
- package/terminal-proxy.ts +50 -0
- package/transcript.ts +13 -0
- package/web/app.css +187 -55
- package/web/app.js +5187 -4619
- package/web/assets/markdown.LICENSE.txt +200 -0
- package/web/assets/markdown.js +25 -0
- package/web/assets/themes/sakura.webp +0 -0
- package/web/assets/themes/starlight.webp +0 -0
- package/web/index.html +5 -1
- package/web/markdown.ts +118 -0
- package/web/slash-commands.d.ts +11 -0
- package/web/slash-commands.js +46 -0
- package/web/themes.css +158 -0
package/pi-rpc.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { existsSync, readFileSync } from "node:fs";
|
|
|
4
4
|
import { join, resolve } from "node:path";
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
6
6
|
import { getPackageDir } from "@earendil-works/pi-coding-agent";
|
|
7
|
+
import { terminalProxyEnv, type TerminalProxySettings } from "./terminal-proxy.ts";
|
|
7
8
|
|
|
8
9
|
export type Json = Record<string, any>;
|
|
9
10
|
|
|
@@ -72,6 +73,7 @@ export interface PiRpcSpawnOptions {
|
|
|
72
73
|
sessionFile?: string;
|
|
73
74
|
name?: string;
|
|
74
75
|
noSession?: boolean;
|
|
76
|
+
proxy?: TerminalProxySettings;
|
|
75
77
|
}
|
|
76
78
|
|
|
77
79
|
export function spawnPiRpc(options: PiRpcSpawnOptions): PiRpc {
|
|
@@ -95,7 +97,7 @@ export function spawnPiRpc(options: PiRpcSpawnOptions): PiRpc {
|
|
|
95
97
|
const child = spawn(executable, childArgs, {
|
|
96
98
|
cwd: options.cwd,
|
|
97
99
|
env: {
|
|
98
|
-
...process.env, NO_COLOR: "1", PI_TELEMETRY: "0",
|
|
100
|
+
...(options.proxy ? terminalProxyEnv(options.proxy) : process.env), NO_COLOR: "1", PI_TELEMETRY: "0",
|
|
99
101
|
...(windows ? { PI_WEB_RPC_JOB: JSON.stringify({ ownerPid: process.pid, executable: process.execPath, args: [launch.entry, ...args], cwd: options.cwd }) } : {}),
|
|
100
102
|
},
|
|
101
103
|
stdio: ["pipe", "pipe", "pipe"],
|
|
@@ -160,8 +162,8 @@ export function spawnPiRpc(options: PiRpcSpawnOptions): PiRpc {
|
|
|
160
162
|
console.error(`[pi-web rpc stderr] ${text}`);
|
|
161
163
|
};
|
|
162
164
|
|
|
163
|
-
child.stderr?.on("data", (chunk:
|
|
164
|
-
stderrBuffer += chunk
|
|
165
|
+
child.stderr?.setEncoding("utf8").on("data", (chunk: string) => {
|
|
166
|
+
stderrBuffer += chunk;
|
|
165
167
|
let idx: number;
|
|
166
168
|
while ((idx = stderrBuffer.indexOf("\n")) >= 0) {
|
|
167
169
|
logStderrLine(stderrBuffer.slice(0, idx));
|
|
@@ -173,8 +175,8 @@ export function spawnPiRpc(options: PiRpcSpawnOptions): PiRpc {
|
|
|
173
175
|
stderrBuffer = "";
|
|
174
176
|
});
|
|
175
177
|
|
|
176
|
-
child.stdout?.on("data", (chunk:
|
|
177
|
-
buffer += chunk
|
|
178
|
+
child.stdout?.setEncoding("utf8").on("data", (chunk: string) => {
|
|
179
|
+
buffer += chunk;
|
|
178
180
|
let idx: number;
|
|
179
181
|
while ((idx = buffer.indexOf("\n")) >= 0) {
|
|
180
182
|
let line = buffer.slice(0, idx);
|