pi-web-ui 0.8.5 → 0.8.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.
|
@@ -955,18 +955,23 @@ export class ClientSession {
|
|
|
955
955
|
async checkUpdate() {
|
|
956
956
|
const current = ClientSession.currentAppVersion();
|
|
957
957
|
try {
|
|
958
|
-
|
|
958
|
+
// Fetch the full package doc (not /latest): it carries the per-version
|
|
959
|
+
// publish timestamps so the UI can hint when a version was JUST
|
|
960
|
+
// published and the registry/CDN caches may not have caught up yet.
|
|
961
|
+
const res = await fetch("https://registry.npmjs.org/pi-web-ui", {
|
|
959
962
|
signal: AbortSignal.timeout(8_000),
|
|
960
963
|
});
|
|
961
964
|
if (!res.ok)
|
|
962
965
|
throw new Error(`HTTP ${res.status}`);
|
|
963
966
|
const data = (await res.json());
|
|
964
|
-
const latest = data
|
|
967
|
+
const latest = data["dist-tags"]?.latest ?? null;
|
|
968
|
+
const latestPublishedAt = latest && data.time ? (data.time[latest] ?? null) : null;
|
|
965
969
|
const upToDate = latest === null || ClientSession.compareVersions(current, latest) >= 0;
|
|
966
970
|
this.emit({
|
|
967
971
|
type: "update_status",
|
|
968
972
|
current,
|
|
969
973
|
latest,
|
|
974
|
+
latestPublishedAt,
|
|
970
975
|
upToDate,
|
|
971
976
|
pendingRestart: this.pendingRestart,
|
|
972
977
|
});
|
|
@@ -976,6 +981,7 @@ export class ClientSession {
|
|
|
976
981
|
type: "update_status",
|
|
977
982
|
current,
|
|
978
983
|
latest: null,
|
|
984
|
+
latestPublishedAt: null,
|
|
979
985
|
upToDate: false,
|
|
980
986
|
pendingRestart: this.pendingRestart,
|
|
981
987
|
error: `检查更新失败:${err.message}`,
|
|
@@ -1751,7 +1757,11 @@ export class ClientSession {
|
|
|
1751
1757
|
isStreaming,
|
|
1752
1758
|
});
|
|
1753
1759
|
}
|
|
1754
|
-
this.emit({
|
|
1760
|
+
this.emit({
|
|
1761
|
+
type: "conversations",
|
|
1762
|
+
conversations,
|
|
1763
|
+
activeId: this.activeId,
|
|
1764
|
+
});
|
|
1755
1765
|
}
|
|
1756
1766
|
/** List persisted sessions for this client, newest first. */
|
|
1757
1767
|
/** Push the persisted session list to the client (client-requested). */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-web-ui",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.6",
|
|
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
|
"type": "module",
|