@llblab/pi-kit 0.1.10 → 0.1.12

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/CHANGELOG.md CHANGED
@@ -2,6 +2,15 @@
2
2
 
3
3
  All notable changes to `@llblab/pi-kit` are documented here.
4
4
 
5
+ ## 0.1.12 - 2026-08-28
6
+
7
+ - `Codex Usage Release`: Advances `@llblab/pi-codex-usage` to `0.9.4`, reducing automatic OpenAI quota polling by increasing the refresh interval from 30 to 60 seconds while preserving the local countdown responsiveness.
8
+ - `Telegram Hotfix`: Advances `@llblab/pi-telegram` to `0.39.5`, preserving terminal-equivalent chronology by delivering an active turn's final Telegram answer before automatic-compaction start and completion notices.
9
+
10
+ ## 0.1.11 - 2026-08-28
11
+
12
+ - `Telegram Hotfix`: Advances `@llblab/pi-telegram` to `0.39.4`, preventing repeated extension errors when print, RPC, ACP, or other headless hosts refresh lifecycle status without an initialized theme while preserving interactive status rendering.
13
+
5
14
  ## 0.1.10 - 2026-08-26
6
15
 
7
16
  - `Extension Releases`: Advances `@llblab/pi-grow-loop` to `0.7.3` for the current bounded continuation protocol and `@llblab/pi-telegram` to `0.39.3` for Windows IPC replacement fencing, trusted outbound voice command compatibility, and macOS lock-recovery contention handling.
package/README.md CHANGED
@@ -7,9 +7,9 @@
7
7
  | Package | Version | Resources |
8
8
  | --- | ---: | --- |
9
9
  | `@llblab/pi-actors` | `0.50.0` | Extension and Skills |
10
- | `@llblab/pi-codex-usage` | `0.9.3` | Extension |
10
+ | `@llblab/pi-codex-usage` | `0.9.4` | Extension |
11
11
  | `@llblab/pi-grow-loop` | `0.7.3` | Extension and Skills |
12
- | `@llblab/pi-telegram` | `0.39.3` | Extension and Skills |
12
+ | `@llblab/pi-telegram` | `0.39.5` | Extension and Skills |
13
13
 
14
14
  Versions are exact by design. Updating an extension does not change an installed kit until this repository explicitly advances that dependency and publishes a new kit version.
15
15
 
@@ -1,8 +1,3 @@
1
1
  # Backlog
2
2
 
3
- ## Pending Release Verification
4
-
5
- - [x] Fix stale extension context usage after session replacement or reload. Source: GitHub issue #1. Timers must not keep using captured stale `ctx` after Pi session lifecycle changes.
6
- - [x] Make usage refresh cache/in-flight state model-aware for Codex vs Spark. A regular Codex cache or request must not temporarily render Spark as `n/a` after model switching.
7
- - [x] Preserve the active `codex`/`spark` label for failure states. Spark failures should render `spark n/a` or `spark error`, not `codex ...`.
8
- - [x] Replace the visually full startup/request placeholder with counter-moving upper/lower in-bar loading markers. Keep the last usable active-bucket bar visible during ordinary refreshes, and hold provisional zero-usage reports behind the loader until confirmed stable.
3
+ No open work.
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.9.4: Responsive Quota Polling
4
+
5
+ - Increased the automatic Codex quota refresh interval from 30 to 60 seconds. Impact: status values remain responsive down to the locally rendered seconds countdown while reducing repeated OpenAI requests, especially when several Pi instances are open.
6
+
3
7
  ## 0.9.3: Trusted Release Automation
4
8
 
5
9
  - Added tag-gated release automation with exact package/lock/tag identity checks, full package validation, npm Trusted Publisher provenance, public registry verification, and workflow-owned GitHub Release creation through `.github/workflows/release.yml`.
@@ -14,7 +14,7 @@ This repository is a minimal fork of [`narumiruna/pi-extensions/extensions/pi-co
14
14
 
15
15
  ## Features
16
16
 
17
- - Shows two counter-moving half-height markers in the statusline bar while the active Codex/Spark quota bucket is loading, then refreshes every 30 seconds
17
+ - Shows two counter-moving half-height markers in the statusline bar while the active Codex/Spark quota bucket is loading, then refreshes every 60 seconds
18
18
  - Keeps the last usable active-bucket bar visible during ordinary refreshes instead of replacing known quota with a loading state
19
19
  - Statusline output adapts to the response: weekly-only limits show an explicit remaining percentage and reset countdown, while dual-window limits keep the compact themed bar
20
20
  - Regular Codex subscription models show the primary `codex` quota bucket
@@ -16,7 +16,7 @@ const HOUR_MS = 60 * MINUTE_MS;
16
16
  const HOUR_TENTH_MS = 6 * MINUTE_MS;
17
17
  const DAY_MS = 24 * HOUR_MS;
18
18
  const DAY_TENTH_MS = 144 * MINUTE_MS;
19
- const REFRESH_INTERVAL_MS = 30 * SECOND_MS;
19
+ const REFRESH_INTERVAL_MS = 60 * SECOND_MS;
20
20
  const PROVISIONAL_RETRY_MS = SECOND_MS;
21
21
  const FULL_AVAILABILITY_CONFIRMATION_MS = 15 * SECOND_MS;
22
22
  const LOADING_FRAME_MS = 30;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@llblab/pi-codex-usage",
3
- "version": "0.9.3",
3
+ "version": "0.9.4",
4
4
  "private": false,
5
5
  "description": "Minimal Pi extension that shows primary Codex ChatGPT subscription usage limits",
6
6
  "keywords": [
@@ -2,6 +2,14 @@
2
2
 
3
3
  > Each release keeps at most 8 outcome records of at most 512 characters.
4
4
 
5
+ ## 0.39.5: Auto-Compaction Notice Chronology Hotfix
6
+
7
+ - `Turn Chronology`: Defers observed automatic-compaction notices while a Telegram turn is still active, preserving the same causal order shown by the terminal: final answer, compaction started, then compaction completed. Abandoned compactions and session shutdown discard deferred notices instead of leaking them into a later turn.
8
+
9
+ ## 0.39.4: Headless Status Bar Hotfix
10
+
11
+ - `Headless Hosts`: Skips status-bar rendering when a print, RPC, ACP, or other non-interactive host has not initialized its theme, preventing repeated extension errors during lifecycle status refreshes while preserving normal interactive status updates and error propagation.
12
+
5
13
  ## 0.39.3: Windows IPC And Outbound Voice Hotfix
6
14
 
7
15
  - `Windows IPC Replacement`: Replaces an older same-process Named Pipe server before a new session generation listens on the stable endpoint, preventing `EADDRINUSE` during reload while keeping a late stop from invalidating its successor.
@@ -1028,6 +1028,7 @@ export function registerTelegramLifecycleRuntimeHooks({
1028
1028
  });
1029
1029
  };
1030
1030
  let observedAutomaticCompaction = false;
1031
+ const deferredAutomaticCompactionNotices: string[] = [];
1031
1032
  const sendCompactionNotice = async (text: string): Promise<void> => {
1032
1033
  const turn = activeTurnRuntime.get();
1033
1034
  const target = turn?.target ?? proactivePushTargetGetter?.();
@@ -1042,6 +1043,10 @@ export function registerTelegramLifecycleRuntimeHooks({
1042
1043
  });
1043
1044
  }
1044
1045
  };
1046
+ const flushDeferredAutomaticCompactionNotices = async (): Promise<void> => {
1047
+ const notices = deferredAutomaticCompactionNotices.splice(0);
1048
+ for (const notice of notices) await sendCompactionNotice(notice);
1049
+ };
1045
1050
  const compactionObserver = Lifecycle.createTelegramCompactionObserverRuntime({
1046
1051
  isContextActive: isSessionContextActive,
1047
1052
  setCompactionInProgress: lifecycle.setCompactionInProgress,
@@ -1054,6 +1059,7 @@ export function registerTelegramLifecycleRuntimeHooks({
1054
1059
  recordRuntimeEvent,
1055
1060
  onCompactionAbandoned: () => {
1056
1061
  observedAutomaticCompaction = false;
1062
+ deferredAutomaticCompactionNotices.length = 0;
1057
1063
  activityRuntime.onCompactionAbandoned();
1058
1064
  },
1059
1065
  });
@@ -1088,6 +1094,7 @@ export function registerTelegramLifecycleRuntimeHooks({
1088
1094
  activityVerbosityRuntime?.reset();
1089
1095
  assistantOutputRuntime.stop();
1090
1096
  observedAutomaticCompaction = false;
1097
+ deferredAutomaticCompactionNotices.length = 0;
1091
1098
  compactionObserver.onSessionShutdown();
1092
1099
  if (event.reason === "quit" && disconnectOnQuit) {
1093
1100
  try {
@@ -1109,11 +1116,17 @@ export function registerTelegramLifecycleRuntimeHooks({
1109
1116
  activityRuntime.onCompactionStart(Pi.getSessionCompactionReason(event));
1110
1117
  compactionObserver.onSessionBeforeCompact(event, ctx);
1111
1118
  if (shouldNotify) {
1112
- await waitForActiveTurnDelivery();
1113
- if (!isSessionContextActive(ctx)) return;
1114
- await sendCompactionNotice(
1115
- Commands.TELEGRAM_COMPACTION_STARTED_MARKDOWN,
1116
- );
1119
+ if (activeTurnRuntime.has()) {
1120
+ deferredAutomaticCompactionNotices.push(
1121
+ Commands.TELEGRAM_COMPACTION_STARTED_MARKDOWN,
1122
+ );
1123
+ } else {
1124
+ await waitForActiveTurnDelivery();
1125
+ if (!isSessionContextActive(ctx)) return;
1126
+ await sendCompactionNotice(
1127
+ Commands.TELEGRAM_COMPACTION_STARTED_MARKDOWN,
1128
+ );
1129
+ }
1117
1130
  }
1118
1131
  },
1119
1132
  async onSessionCompact(event, ctx) {
@@ -1122,9 +1135,18 @@ export function registerTelegramLifecycleRuntimeHooks({
1122
1135
  compactionObserver.onSessionCompact(event, ctx);
1123
1136
  if (observedAutomaticCompaction) {
1124
1137
  observedAutomaticCompaction = false;
1125
- await sendCompactionNotice(
1126
- Commands.TELEGRAM_COMPACTION_COMPLETED_MARKDOWN,
1127
- );
1138
+ if (
1139
+ activeTurnRuntime.has() ||
1140
+ deferredAutomaticCompactionNotices.length > 0
1141
+ ) {
1142
+ deferredAutomaticCompactionNotices.push(
1143
+ Commands.TELEGRAM_COMPACTION_COMPLETED_MARKDOWN,
1144
+ );
1145
+ } else {
1146
+ await sendCompactionNotice(
1147
+ Commands.TELEGRAM_COMPACTION_COMPLETED_MARKDOWN,
1148
+ );
1149
+ }
1128
1150
  }
1129
1151
  },
1130
1152
  async onAgentStart(event, ctx) {
@@ -1177,6 +1199,11 @@ export function registerTelegramLifecycleRuntimeHooks({
1177
1199
  if (!isSessionContextActive(ctx)) return;
1178
1200
  activityRuntime.onAgentEnd();
1179
1201
  await agentLifecycleHooks.onAgentEnd(event, ctx);
1202
+ if (deferredAutomaticCompactionNotices.length > 0) {
1203
+ await waitForActiveTurnDelivery();
1204
+ if (!isSessionContextActive(ctx)) return;
1205
+ await flushDeferredAutomaticCompactionNotices();
1206
+ }
1180
1207
  },
1181
1208
  async onAgentSettled(event, ctx) {
1182
1209
  if (!isSessionContextActive(ctx)) return;
@@ -628,18 +628,28 @@ export function createTelegramStatusHtmlBuilder<TContext>(deps: {
628
628
  );
629
629
  }
630
630
 
631
+ function resolveStatusBarTheme(
632
+ ctx: TelegramStatusRuntimeContext,
633
+ ): TelegramStatusBarTheme | undefined {
634
+ try {
635
+ const theme = ctx.ui?.theme;
636
+ return typeof theme?.fg === "function" ? theme : undefined;
637
+ } catch {
638
+ return undefined;
639
+ }
640
+ }
641
+
631
642
  export function createTelegramStatusRuntime<
632
643
  TContext extends TelegramStatusRuntimeContext,
633
644
  >(deps: TelegramStatusRuntimeDeps<TContext>): TelegramStatusRuntime<TContext> {
634
645
  const statusKey = deps.statusKey ?? "telegram";
635
646
  return {
636
647
  updateStatus: (ctx, error) => {
648
+ const theme = resolveStatusBarTheme(ctx);
649
+ if (!theme) return;
637
650
  ctx.ui.setStatus(
638
651
  statusKey,
639
- buildTelegramStatusBarText(
640
- ctx.ui.theme,
641
- deps.getStatusBarState(ctx, error),
642
- ),
652
+ buildTelegramStatusBarText(theme, deps.getStatusBarState(ctx, error)),
643
653
  );
644
654
  },
645
655
  getStatusLines: (options) =>
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@llblab/pi-telegram",
3
- "version": "0.39.3",
3
+ "version": "0.39.5",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@llblab/pi-kit",
3
- "version": "0.1.10",
3
+ "version": "0.1.12",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -41,9 +41,9 @@
41
41
  ],
42
42
  "dependencies": {
43
43
  "@llblab/pi-actors": "0.50.0",
44
- "@llblab/pi-codex-usage": "0.9.3",
44
+ "@llblab/pi-codex-usage": "0.9.4",
45
45
  "@llblab/pi-grow-loop": "0.7.3",
46
- "@llblab/pi-telegram": "0.39.3"
46
+ "@llblab/pi-telegram": "0.39.5"
47
47
  },
48
48
  "bundledDependencies": [
49
49
  "@llblab/pi-actors",