pi-web-ui 0.48.1 → 0.48.3
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/dist/server/agent-service.js +5 -16
- package/dist/server/model-admin.js +2 -0
- package/dist/server/webui-context.js +6 -4
- package/package.json +4 -4
- package/themes/cyberpunk.css +7658 -0
- package/themes/dazzle.css +7985 -0
- package/themes/md-preview.css +42 -85
- package/themes/white.css +42 -85
- package/web/dist/assets/{TerminalPanel-zmg6ssVv.js → TerminalPanel-CsLJErXe.js} +1 -1
- package/web/dist/assets/index-B4Bb2-Uw.css +10 -0
- package/web/dist/assets/index-verW8_Ym.js +319 -0
- package/web/dist/index.html +2 -2
- package/web/dist/assets/index-B22rO2Ct.css +0 -10
- package/web/dist/assets/index-ChxqCQTs.js +0 -319
|
@@ -1332,28 +1332,17 @@ export class ClientSession {
|
|
|
1332
1332
|
this.webUi.resolveDialog(id, value);
|
|
1333
1333
|
}
|
|
1334
1334
|
/**
|
|
1335
|
-
* Whether the pi agent
|
|
1336
|
-
*
|
|
1335
|
+
* Whether the pi agent has at least one usable model. ModelRuntime's
|
|
1336
|
+
* available snapshot already accounts for models.json, auth.json, env-var
|
|
1337
|
+
* credentials, OAuth, and runtime API-key overrides. Cached for 2s because
|
|
1338
|
+
* this is called while building frequent snapshots.
|
|
1337
1339
|
*/
|
|
1338
1340
|
isPiConfigured() {
|
|
1339
1341
|
const now = Date.now();
|
|
1340
1342
|
const cached = this.piCheckCache;
|
|
1341
1343
|
if (cached && now - cached.at < 2000)
|
|
1342
1344
|
return cached.configured;
|
|
1343
|
-
|
|
1344
|
-
try {
|
|
1345
|
-
const authPath = join(this.agentDir, "auth.json");
|
|
1346
|
-
if (existsSync(authPath)) {
|
|
1347
|
-
const data = JSON.parse(readFileSync(authPath, "utf8"));
|
|
1348
|
-
configured =
|
|
1349
|
-
typeof data === "object" &&
|
|
1350
|
-
data !== null &&
|
|
1351
|
-
Object.keys(data).length > 0;
|
|
1352
|
-
}
|
|
1353
|
-
}
|
|
1354
|
-
catch {
|
|
1355
|
-
configured = false;
|
|
1356
|
-
}
|
|
1345
|
+
const configured = (this.sharedModelRuntime?.getAvailableSnapshot().length ?? 0) > 0;
|
|
1357
1346
|
this.piCheckCache = { at: now, configured };
|
|
1358
1347
|
return configured;
|
|
1359
1348
|
}
|
|
@@ -769,6 +769,7 @@ export class ModelAdminService {
|
|
|
769
769
|
// auth.json is optional; models.json can still use its own apiKey.
|
|
770
770
|
}
|
|
771
771
|
await this.host.modelRuntime().refresh();
|
|
772
|
+
this.host.invalidatePiConfig();
|
|
772
773
|
await this.listModelsConfig();
|
|
773
774
|
await this.host.pushModels();
|
|
774
775
|
this.host.emit({
|
|
@@ -801,6 +802,7 @@ export class ModelAdminService {
|
|
|
801
802
|
delete providers[providerId];
|
|
802
803
|
writeFileSync(this.modelsConfigPath(), JSON.stringify({ providers }, null, 2) + "\n");
|
|
803
804
|
await this.host.modelRuntime().refresh();
|
|
805
|
+
this.host.invalidatePiConfig();
|
|
804
806
|
await this.listModelsConfig();
|
|
805
807
|
await this.host.pushModels();
|
|
806
808
|
this.host.emit({
|
|
@@ -115,12 +115,14 @@ export class WebUIContext {
|
|
|
115
115
|
});
|
|
116
116
|
}
|
|
117
117
|
// -- notifications --------------------------------------------------------
|
|
118
|
-
|
|
118
|
+
// Instance arrows so these survive the SDK's wrapUIPromptContext `{ ...ui }`
|
|
119
|
+
// (object spread copies own properties only, not class prototype methods).
|
|
120
|
+
notify = (message, type) => {
|
|
119
121
|
this.emit({ type: "notice", level: type ?? "info", text: message });
|
|
120
|
-
}
|
|
122
|
+
};
|
|
121
123
|
// -- footer status (pi-lens "LSP Inactive", pi-cache-optimizer cache stats) --
|
|
122
124
|
statuses = new Map();
|
|
123
|
-
setStatus(key, text) {
|
|
125
|
+
setStatus = (key, text) => {
|
|
124
126
|
if (text === undefined || text === "") {
|
|
125
127
|
this.statuses.delete(key);
|
|
126
128
|
}
|
|
@@ -133,7 +135,7 @@ export class WebUIContext {
|
|
|
133
135
|
this.statuses.set(key, clean);
|
|
134
136
|
}
|
|
135
137
|
this.pushStatuses();
|
|
136
|
-
}
|
|
138
|
+
};
|
|
137
139
|
pushStatuses() {
|
|
138
140
|
this.emit({
|
|
139
141
|
type: "statuses",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-web-ui",
|
|
3
|
-
"version": "0.48.
|
|
3
|
+
"version": "0.48.3",
|
|
4
4
|
"description": "Web chat interface for the pi coding agent, powered by the pi SDK (@earendil-works/pi-coding-agent) — one-command run, Docker/systemd/launchd deployable",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -68,10 +68,11 @@
|
|
|
68
68
|
"publish:electron": "electron-builder build --publish always"
|
|
69
69
|
},
|
|
70
70
|
"dependencies": {
|
|
71
|
-
"@earendil-works/pi-coding-agent": "^0.84.
|
|
71
|
+
"@earendil-works/pi-coding-agent": "^0.84.4",
|
|
72
72
|
"@xterm/addon-fit": "^0.11.0",
|
|
73
73
|
"@xterm/xterm": "^6.0.0",
|
|
74
74
|
"compression": "^1.8.1",
|
|
75
|
+
"electron-updater": "^6.0.0",
|
|
75
76
|
"express": "^4.21.2",
|
|
76
77
|
"highlight.js": "^11.10.0",
|
|
77
78
|
"node-pty": "^1.1.0",
|
|
@@ -100,8 +101,7 @@
|
|
|
100
101
|
"vite": "^6.0.3",
|
|
101
102
|
"vitest": "^4.1.11",
|
|
102
103
|
"electron": "^41.0.0",
|
|
103
|
-
"electron-builder": "^25.0.0"
|
|
104
|
-
"electron-updater": "^6.0.0"
|
|
104
|
+
"electron-builder": "^25.0.0"
|
|
105
105
|
},
|
|
106
106
|
"allowScripts": {
|
|
107
107
|
"node-pty@1.1.0": true,
|