@pi-unipi/footer 3.0.0-alpha.33 → 3.0.0-alpha.34
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/package.json +3 -3
- package/src/index.ts +3 -0
- package/src/tps-shared.ts +19 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-unipi/footer",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.34",
|
|
4
4
|
"description": "Persistent status bar for Unipi — subscribes to UNIPI_EVENTS and renders key stats from all unipi packages",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.ts",
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"access": "public"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@pi-unipi/core": "3.0.0-alpha.
|
|
36
|
-
"@pi-unipi/background-tasks": "3.0.0-alpha.
|
|
35
|
+
"@pi-unipi/core": "3.0.0-alpha.34",
|
|
36
|
+
"@pi-unipi/background-tasks": "3.0.0-alpha.34"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"@earendil-works/pi-coding-agent": "^0.87.1",
|
package/src/index.ts
CHANGED
|
@@ -25,12 +25,15 @@ import { registerCommands } from "./commands.js";
|
|
|
25
25
|
import { GlanceEditor } from "./glance-editor.js";
|
|
26
26
|
import type { GlanceStatus } from "./glance-editor.js";
|
|
27
27
|
import { tpsTracker } from "./tps-tracker.js";
|
|
28
|
+
import { publishSharedTps } from "./tps-shared.js";
|
|
28
29
|
import { renderProcessLine, countBgProcesses } from "./process-line.js";
|
|
29
30
|
import { lhModeLabel } from "./segments/long-horizon.js";
|
|
30
31
|
import { SessionScanner } from "./session-scan.js";
|
|
31
32
|
import { renderSessionStrip, stripVisibleAtRows } from "./strip.js";
|
|
32
33
|
import { setIconStyle } from "./rendering/icons.js";
|
|
33
34
|
|
|
35
|
+
publishSharedTps();
|
|
36
|
+
|
|
34
37
|
/** Package version (from this package's package.json). */
|
|
35
38
|
const VERSION = getPackageVersion(
|
|
36
39
|
findPackageRoot(dirname(fileURLToPath(import.meta.url)), "@pi-unipi/footer") ?? dirname(fileURLToPath(import.meta.url)),
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared TpsTracker accessor (same pattern as background-tasks'
|
|
3
|
+
* registry-shared.ts): exposes the live session tracker to sibling
|
|
4
|
+
* extensions (the app bridge's stats push, UNI-160 §3) without a hard
|
|
5
|
+
* dependency on @pi-unipi/footer.
|
|
6
|
+
*/
|
|
7
|
+
import { tpsTracker, type TpsTracker } from "./tps-tracker.js";
|
|
8
|
+
|
|
9
|
+
const SHARED_TPS_KEY = Symbol.for("unipi.footer.shared-tps");
|
|
10
|
+
|
|
11
|
+
/** Idempotent: the module-level singleton is always the same instance, so
|
|
12
|
+
* this just makes it reachable from globalThis too. */
|
|
13
|
+
export function publishSharedTps(): void {
|
|
14
|
+
(globalThis as unknown as Record<symbol, unknown>)[SHARED_TPS_KEY] = tpsTracker;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function getSharedTps(): TpsTracker | undefined {
|
|
18
|
+
return (globalThis as unknown as Record<symbol, unknown>)[SHARED_TPS_KEY] as TpsTracker | undefined;
|
|
19
|
+
}
|