pi-web-ui 0.62.0 → 0.63.0
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/LICENSE +21 -21
- package/README.md +504 -497
- package/README.zh-CN.md +427 -422
- package/bin/pi-web-ui.mjs +1809 -1881
- package/deploy/com.xingshuyin.pi-web-ui.plist +48 -48
- package/deploy/nginx-subpath.conf +88 -88
- package/deploy/pi-web-ui-task.xml +54 -54
- package/deploy/pi-web-ui.service +31 -31
- package/dist/server/agent-service.js +318 -88
- package/dist/server/attachments.js +37 -28
- package/dist/server/bg-servers.js +6 -1
- package/dist/server/client-state.js +15 -7
- package/dist/server/control-socket.js +1 -5
- package/dist/server/dsh/dsh-agent-service.js +454 -118
- package/dist/server/dsh/dsh-client.js +1 -3
- package/dist/server/dsh/dsh-sessions.js +4 -14
- package/dist/server/dsh/runtime/cordis.yml +1 -1
- package/dist/server/dsh/runtime/goal-rpc.mjs +645 -662
- package/dist/server/dsh/runtime/launcher.mjs +8 -18
- package/dist/server/dsh/runtime/override.patch.yml +9 -9
- package/dist/server/dsh/runtime/runtime-root.mjs +7 -11
- package/dist/server/ensure-bash.js +2 -5
- package/dist/server/files-service.js +42 -36
- package/dist/server/goal-service.js +59 -30
- package/dist/server/index.js +17 -10
- package/dist/server/mcp-bridge.js +11 -5
- package/dist/server/model-admin.js +78 -72
- package/dist/server/plugin-facilities.js +2 -4
- package/dist/server/plugin-updater.js +1 -1
- package/dist/server/plugins.js +26 -8
- package/dist/server/process-utils.js +4 -4
- package/dist/server/protocol-version.js +1 -1
- package/dist/server/scm.js +27 -21
- package/dist/server/serialize.js +1 -3
- package/dist/server/settings-service.js +63 -21
- package/dist/server/slash-commands.js +29 -3
- package/dist/server/subagent-templates.js +249 -0
- package/dist/server/subagents.js +150 -0
- package/dist/server/terminals.js +101 -40
- package/dist/server/text-sniff.js +4 -24
- package/dist/server/update-check.js +2 -4
- package/dist/server/uploads.js +1 -3
- package/dist/server/vision-bridge.js +2 -7
- package/dist/server/wait-subscription-scan.js +102 -21
- package/dist/server/webui-context.js +1 -1
- package/extensions/webui.ts +190 -192
- package/package.json +109 -103
- package/web/dist/assets/TerminalPanel-B9vcI7-_.js +2 -0
- package/web/dist/assets/index-B8Wv29p5.css +10 -0
- package/web/dist/assets/index-CWUWD0rq.js +323 -0
- package/web/dist/favicon.svg +8 -8
- package/web/dist/index.html +15 -15
- package/web/public/favicon.svg +8 -8
- package/web/dist/assets/TerminalPanel-BkCWDsIG.js +0 -2
- package/web/dist/assets/index-BRVKed7W.js +0 -321
- package/web/dist/assets/index-ORTpR6ZQ.css +0 -10
|
@@ -98,9 +98,7 @@ export class DshRuntime {
|
|
|
98
98
|
this.sessionRoot = opts.sessionRoot;
|
|
99
99
|
this.dataDir = opts.dataDir;
|
|
100
100
|
this.agentDir = opts.agentDir;
|
|
101
|
-
this.launcher =
|
|
102
|
-
opts.launcher ??
|
|
103
|
-
join(dirname(fileURLToPath(import.meta.url)), "runtime", "launcher.mjs");
|
|
101
|
+
this.launcher = opts.launcher ?? join(dirname(fileURLToPath(import.meta.url)), "runtime", "launcher.mjs");
|
|
104
102
|
this.jsonrpcEntry =
|
|
105
103
|
opts.jsonrpcEntry ??
|
|
106
104
|
(() => {
|
|
@@ -37,9 +37,7 @@ export function projectKey(cwd) {
|
|
|
37
37
|
/** 解包一条存储记录:打包的 chunk 行 → 多个 assistant/chunk 事件;否则原样返回。 */
|
|
38
38
|
function decodeStorageRecord(value) {
|
|
39
39
|
const t = value.type;
|
|
40
|
-
if (t === "text-chunks" ||
|
|
41
|
-
t === "reasoning-chunks" ||
|
|
42
|
-
t === "tool-call-chunks") {
|
|
40
|
+
if (t === "text-chunks" || t === "reasoning-chunks" || t === "tool-call-chunks") {
|
|
43
41
|
const { seq0, time0, data } = value;
|
|
44
42
|
if (!data || (!Array.isArray(data.texts) && !Array.isArray(data.args))) {
|
|
45
43
|
return [value];
|
|
@@ -80,10 +78,7 @@ function zstdDecompressAll(buf) {
|
|
|
80
78
|
const MAGIC = Buffer.from([0x28, 0xb5, 0x2f, 0xfd]);
|
|
81
79
|
const starts = [];
|
|
82
80
|
for (let i = 0; i + 4 <= buf.length; i++) {
|
|
83
|
-
if (buf[i] === MAGIC[0] &&
|
|
84
|
-
buf[i + 1] === MAGIC[1] &&
|
|
85
|
-
buf[i + 2] === MAGIC[2] &&
|
|
86
|
-
buf[i + 3] === MAGIC[3]) {
|
|
81
|
+
if (buf[i] === MAGIC[0] && buf[i + 1] === MAGIC[1] && buf[i + 2] === MAGIC[2] && buf[i + 3] === MAGIC[3]) {
|
|
87
82
|
starts.push(i);
|
|
88
83
|
}
|
|
89
84
|
}
|
|
@@ -103,9 +98,7 @@ function zstdDecompressAll(buf) {
|
|
|
103
98
|
/** 读一个会话 JSONL 文件 → { header, events }。 */
|
|
104
99
|
export function readSessionLog(file) {
|
|
105
100
|
const raw = readFileSync(file);
|
|
106
|
-
const text = file.endsWith(".jsonl.zstd")
|
|
107
|
-
? zstdDecompressAll(raw)
|
|
108
|
-
: raw.toString("utf8");
|
|
101
|
+
const text = file.endsWith(".jsonl.zstd") ? zstdDecompressAll(raw) : raw.toString("utf8");
|
|
109
102
|
const lines = text.split("\n").filter((l) => l.trim());
|
|
110
103
|
let header = null;
|
|
111
104
|
const events = [];
|
|
@@ -156,10 +149,7 @@ export function findSessionFiles(root) {
|
|
|
156
149
|
}
|
|
157
150
|
/** 一个工作区的会话文件:官方布局(root/--<cwd>--)+ 旧版 per-cwd 布局。 */
|
|
158
151
|
export function findSessionFilesForCwd(sessionRoot, cwd) {
|
|
159
|
-
const dirs = [
|
|
160
|
-
join(sessionRoot, projectKey(cwd)),
|
|
161
|
-
join(sessionRoot, encodeURIComponent(cwd), projectKey(cwd)),
|
|
162
|
-
];
|
|
152
|
+
const dirs = [join(sessionRoot, projectKey(cwd)), join(sessionRoot, encodeURIComponent(cwd), projectKey(cwd))];
|
|
163
153
|
const out = [];
|
|
164
154
|
for (const d of dirs)
|
|
165
155
|
out.push(...findSessionFiles(d));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[]
|
|
1
|
+
[]
|