@llblab/pi-kit 0.31.0 → 0.31.2
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/BACKLOG.md +1 -1
- package/CHANGELOG.md +8 -0
- package/README.md +2 -2
- package/node_modules/@llblab/pi-telegram/CHANGELOG.md +14 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/bindings.d.ts +3 -1
- package/node_modules/@llblab/pi-telegram/dist/lib/bindings.js +2 -1
- package/node_modules/@llblab/pi-telegram/dist/lib/extension.js +8 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/routing.d.ts +8 -1
- package/node_modules/@llblab/pi-telegram/dist/lib/routing.js +338 -63
- package/node_modules/@llblab/pi-telegram/dist/lib/threads.d.ts +2 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/threads.js +4 -2
- package/node_modules/@llblab/pi-telegram/dist/package.json +1 -1
- package/node_modules/@llblab/pi-telegram/docs/architecture.md +5 -5
- package/node_modules/@llblab/pi-telegram/docs/multi-instance-bus.md +2 -2
- package/node_modules/@llblab/pi-telegram/docs/ui-style.md +6 -4
- package/node_modules/@llblab/pi-telegram/lib/bindings.ts +4 -0
- package/node_modules/@llblab/pi-telegram/lib/extension.ts +8 -0
- package/node_modules/@llblab/pi-telegram/lib/routing.ts +434 -78
- package/node_modules/@llblab/pi-telegram/lib/threads.ts +10 -2
- package/node_modules/@llblab/pi-telegram/package.json +1 -1
- package/package.json +2 -2
package/BACKLOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Backlog
|
|
2
2
|
|
|
3
|
-
The 0.31.
|
|
3
|
+
The 0.31.2 composition advances Telegram to 0.54.4; package pins, resource order and bundled runtime ownership remain authoritative in `package.json`. Release outcomes belong in [CHANGELOG.md](./CHANGELOG.md).
|
|
4
4
|
|
|
5
5
|
## Carried checks
|
|
6
6
|
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `@llblab/pi-kit` are documented here.
|
|
4
4
|
|
|
5
|
+
## 0.31.2: Telegram Restore Flow
|
|
6
|
+
|
|
7
|
+
- `Telegram Restore Flow`: Advances the exact Telegram pin to `0.54.4`. Restoring a Pi into a routing tab renames the tab to that Pi's Thread title and keeps the prompt it answers, since an input sent from `All` now moves into its routing tab on desktop and mobile alike. Routing menus disappear after every final choice, every client ends with one routing tab per `All` input, and the old tab is removed right after Pi answers. Other pins, package membership, resources and load order are unchanged.
|
|
8
|
+
|
|
9
|
+
## 0.31.1: Telegram Mobile Routing Tab
|
|
10
|
+
|
|
11
|
+
- `Telegram Mobile Routing`: Advances the exact Telegram pin to `0.54.3`. Sending a command or prompt from `All` in mobile Telegram no longer leaves an extra tab named after the input next to the routing tab; the native tab the mobile client creates is adopted as the routing tab. Other pins, package membership, resources and load order are unchanged.
|
|
12
|
+
|
|
5
13
|
## 0.31.0: Telegram Idle Runtime And Bus Liveness
|
|
6
14
|
|
|
7
15
|
- `Telegram 0.54`: Advances the exact Telegram pin to `0.54.2`. Idle connected sessions make no periodic disk writes: the update journal no longer borrows the `telegram.json` lock and the leader proves liveness over the bus instead of a two-second `state.json` heartbeat. Bus protocol v3 requires updating every Pi process together.
|
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@ Package links lead to the owning repositories for usage, documentation, issues,
|
|
|
18
18
|
| [`@llblab/pi-codex-usage`](https://github.com/llblab/pi-codex-usage) | `0.12.1` | Shared Codex quota/Business credit status and persistent priority Fast toggle, mirrored in Telegram |
|
|
19
19
|
| [`@llblab/pi-grow-loop`](https://github.com/llblab/pi-grow-loop) | `0.9.0` | Visible continuation scheduling and bounded worker Skills through compiled, manifest-owned resources |
|
|
20
20
|
| [`@llblab/pi-state-flow`](https://github.com/llblab/pi-state-flow) | `0.26.4` | Scoped context/memory compiler with step-independent current memory, stable Passive/Active modes and visible blocked-state status |
|
|
21
|
-
| [`@llblab/pi-telegram`](https://github.com/llblab/pi-telegram) | `0.54.
|
|
21
|
+
| [`@llblab/pi-telegram`](https://github.com/llblab/pi-telegram) | `0.54.4` | Telegram companion with live Thread rebinding, temporary routing tabs, Workspace Restore, follower Threads, Windows support, files, voice, and controls |
|
|
22
22
|
| [`@llblab/skills`](https://github.com/llblab/skills) | `1.15.0` | Portable workflows for engineering, review, design, context maintenance, and other focused tasks |
|
|
23
23
|
|
|
24
24
|
Versions are exact by design. An upstream release does not change an installed kit until this repository explicitly advances the dependency and publishes a new kit version. Runtime defects and package-specific feature requests belong in the linked repository; package selection and kit installation issues belong here.
|
|
@@ -45,7 +45,7 @@ Prefer the kit instead of separately loading the same packages. If you already u
|
|
|
45
45
|
|
|
46
46
|
## Development
|
|
47
47
|
|
|
48
|
-
The `0.31.
|
|
48
|
+
The `0.31.2` composition carries Telegram `0.54.4`, which moves an `All` input into its routing tab, renames a restored tab to its Pi's Thread title, keeps routing menus one-shot and removes the old tab right after Pi answers, and `0.54.3`, which keeps mobile Telegram to one routing tab per `All` input, on top of `0.54.2`: an idle connected session no longer writes to disk periodically (the update journal has its own lock instead of the `telegram.json` guard, the leader proves liveness over the bus instead of a two-second `state.json` heartbeat), followers go offline instead of looping when Threaded Mode is switched off, unverifiable ownership checks are recorded and tolerated, and cancelled Generative App methods cannot leave processes behind. Telegram 0.54 uses bus protocol v3: update every Pi process that runs pi-telegram together, because a 0.53.x follower cannot register with a 0.54 leader. State Flow stays at `0.26.4`; all other pins, resources and load order remain unchanged. Telegram runtime storage stays in `tmp/pi-telegram`. Drain the prompt queue or accept losing waiting work before reload/restart; damaged-state reset discards all profiles' runtime continuity. `npm run validate` checks exact installed pins, declared resources, dependency audit and bundled inventory. It does not certify installed-client rendering; carried checks remain in [Backlog](./BACKLOG.md).
|
|
49
49
|
|
|
50
50
|
```bash
|
|
51
51
|
npm install
|
|
@@ -4,6 +4,20 @@
|
|
|
4
4
|
|
|
5
5
|
## Unreleased
|
|
6
6
|
|
|
7
|
+
## 0.54.4: Restored tabs take their Pi's name
|
|
8
|
+
|
|
9
|
+
- `Restore title`: Restoring a Pi into a routing tab ("move Pi into this tab") now renames the tab to that Pi's Thread display title, as Workspace Restore already did; previously a live-rebind Restore left the tab named `🚦 Routing`. A failed rename is recorded and never blocks the Restore.
|
|
10
|
+
- `Native routing tabs`: An `All` input now also adopts a generically named native tab (desktop `New Chat`) that its client created immediately before it, not only a tab named after the input (mobile). Desktop and Android clients, with user topic creation allowed or not, each end with exactly one routing tab; a client's own brief native name before the rename cannot be prevented.
|
|
11
|
+
- `Reclaimed leader tab`: When the leader's own tab is gone (for example after deleting every tab) and a new tab from `All` is reclaimed for it, the leader's Workspace binding now moves to that tab with its slot and name instead of gaining a second slot, and the tab is renamed to its display title instead of staying `New Chat`. Restore and labels no longer point at the deleted tab.
|
|
12
|
+
- `Display titles`: A Thread whose tab has no acknowledged title yet (fresh, moved or reclaimed) now shows its display-mode title, such as the directory title, in the Restore menu and after Restore, instead of falling back to its generated slot name.
|
|
13
|
+
- `One-shot routing menus`: Every final routing choice now deletes its menu. A live-rebind Restore left the chooser in the tab, a Workspace Restore kept it until old-Thread cleanup, which may never come, and Cancel replaced it with a notice. A restored tab stays as the Pi's Thread; a routing tab with nothing left to route is still removed. A delivered Workspace Restore answers `Restored`, not `Restore unconfirmed`, and the Restore submenu now reads `🔁 Restore a Pi into this tab:`.
|
|
14
|
+
- `Restore history`: An input sent from `All` now moves into the routing tab opened for it, on desktop and mobile alike: the tab starts with a silent forward of the input, its menu replies to it, and the original leaves `All` once the copy is confirmed. A Thread restored into that tab keeps the prompt it answers instead of losing it, since the Bot API files such inputs in `All` even when mobile first draws them in the tab.
|
|
15
|
+
- `Old tab cleanup`: After a live-rebind Restore, the old tab is deleted right after Pi finishes answering the moved input, instead of at the next paced retry, which could add up to about 30 seconds and later a full minute. Cleanup still waits for an idle session; a settled agent only wakes the waiting retry early.
|
|
16
|
+
|
|
17
|
+
## 0.54.3: One routing tab on mobile
|
|
18
|
+
|
|
19
|
+
- `Mobile routing tab`: Sending a command or prompt from `All` in mobile Telegram no longer leaves an extra tab named after the input. The mobile client creates that native tab itself before delivering the input to `All`; the bridge now adopts it as the routing tab and renames it, instead of creating a second tab beside it. Desktop behavior is unchanged.
|
|
20
|
+
|
|
7
21
|
## 0.54.2: Diagnosable ownership checks and safe app cancellation
|
|
8
22
|
|
|
9
23
|
- `Ownership checks`: An ownership check that cannot be verified no longer silently stops a live transport. Each such miss is recorded (`ownership-check-failed`) and polling stands down only after two consecutive tolerated misses; a confirmed loss is recorded as `ownership-lost` and stands down at once (#319).
|
|
@@ -291,6 +291,8 @@ interface TelegramLifecycleBindingDeps {
|
|
|
291
291
|
isTurnTransportActive?: (turn: Queue.PendingTelegramTurn) => boolean;
|
|
292
292
|
updateStatus: TelegramBridgeStatusUpdater;
|
|
293
293
|
recordRuntimeEvent: TelegramRuntimeEventRecorder;
|
|
294
|
+
/** Settled-session hint for owners that wait on agent idleness, such as old-tab cleanup after a live rebind. */
|
|
295
|
+
onSessionSettled?: (ctx: Pi.ExtensionContext) => void;
|
|
294
296
|
}
|
|
295
|
-
export declare function registerTelegramLifecycleRuntimeHooks({ pi, publicationRuntime, activityRuntime, activityVerbosityRuntime, diagnostics, assistantOutputRuntime, sessionLifecycleRuntime, configStore, abort, typing, lifecycle, activeTurnRuntime, telegramQueueStore, modelSwitchController, previewRuntime, promptDispatchRuntime, deferredQueueDispatchRuntime, modelContextAvailabilityRuntime, disconnectOnQuit, onSessionStarted, shutdownGenerativeAppLiveSurfaces, resolveAutomaticThreadCleanupEnabled, buttonActionStore, callMultipart, sendChatAction, sendRecordVoiceAction, sendMarkdownReply, sendTextReply, dispatchNextQueuedTelegramTurn, onPromptHandedOff, answerGuestQuery, deleteMessage, sendGuestReply, editGuestReply, stopGuestPlaceholder, preparePreviewDelivery, finalizeMarkdownPreview, proactivePushTargetGetter, getAssistantRenderingMode, recordMessageOwnership, canSendAgentActivity, isSessionContextActive, isTurnTransportActive, updateStatus, recordRuntimeEvent, }: TelegramLifecycleBindingDeps): void;
|
|
297
|
+
export declare function registerTelegramLifecycleRuntimeHooks({ pi, publicationRuntime, activityRuntime, activityVerbosityRuntime, diagnostics, assistantOutputRuntime, sessionLifecycleRuntime, configStore, abort, typing, lifecycle, activeTurnRuntime, telegramQueueStore, modelSwitchController, previewRuntime, promptDispatchRuntime, deferredQueueDispatchRuntime, modelContextAvailabilityRuntime, disconnectOnQuit, onSessionStarted, shutdownGenerativeAppLiveSurfaces, resolveAutomaticThreadCleanupEnabled, buttonActionStore, callMultipart, sendChatAction, sendRecordVoiceAction, sendMarkdownReply, sendTextReply, dispatchNextQueuedTelegramTurn, onPromptHandedOff, answerGuestQuery, deleteMessage, sendGuestReply, editGuestReply, stopGuestPlaceholder, preparePreviewDelivery, finalizeMarkdownPreview, proactivePushTargetGetter, getAssistantRenderingMode, recordMessageOwnership, canSendAgentActivity, isSessionContextActive, isTurnTransportActive, updateStatus, recordRuntimeEvent, onSessionSettled, }: TelegramLifecycleBindingDeps): void;
|
|
296
298
|
export {};
|
|
@@ -626,7 +626,7 @@ export function registerTelegramCommandsAndTools({ pi, agentDir, configStore, pe
|
|
|
626
626
|
},
|
|
627
627
|
});
|
|
628
628
|
}
|
|
629
|
-
export function registerTelegramLifecycleRuntimeHooks({ pi, publicationRuntime, activityRuntime, activityVerbosityRuntime, diagnostics, assistantOutputRuntime, sessionLifecycleRuntime, configStore, abort, typing, lifecycle, activeTurnRuntime, telegramQueueStore, modelSwitchController, previewRuntime, promptDispatchRuntime, deferredQueueDispatchRuntime, modelContextAvailabilityRuntime, disconnectOnQuit, onSessionStarted, shutdownGenerativeAppLiveSurfaces, resolveAutomaticThreadCleanupEnabled, buttonActionStore, callMultipart, sendChatAction, sendRecordVoiceAction, sendMarkdownReply, sendTextReply, dispatchNextQueuedTelegramTurn, onPromptHandedOff, answerGuestQuery, deleteMessage, sendGuestReply, editGuestReply, stopGuestPlaceholder, preparePreviewDelivery, finalizeMarkdownPreview, proactivePushTargetGetter, getAssistantRenderingMode, recordMessageOwnership, canSendAgentActivity, isSessionContextActive = () => true, isTurnTransportActive, updateStatus, recordRuntimeEvent, }) {
|
|
629
|
+
export function registerTelegramLifecycleRuntimeHooks({ pi, publicationRuntime, activityRuntime, activityVerbosityRuntime, diagnostics, assistantOutputRuntime, sessionLifecycleRuntime, configStore, abort, typing, lifecycle, activeTurnRuntime, telegramQueueStore, modelSwitchController, previewRuntime, promptDispatchRuntime, deferredQueueDispatchRuntime, modelContextAvailabilityRuntime, disconnectOnQuit, onSessionStarted, shutdownGenerativeAppLiveSurfaces, resolveAutomaticThreadCleanupEnabled, buttonActionStore, callMultipart, sendChatAction, sendRecordVoiceAction, sendMarkdownReply, sendTextReply, dispatchNextQueuedTelegramTurn, onPromptHandedOff, answerGuestQuery, deleteMessage, sendGuestReply, editGuestReply, stopGuestPlaceholder, preparePreviewDelivery, finalizeMarkdownPreview, proactivePushTargetGetter, getAssistantRenderingMode, recordMessageOwnership, canSendAgentActivity, isSessionContextActive = () => true, isTurnTransportActive, updateStatus, recordRuntimeEvent, onSessionSettled, }) {
|
|
630
630
|
const agentEndResetter = Runtime.createTelegramAgentEndResetter({
|
|
631
631
|
abort,
|
|
632
632
|
typing,
|
|
@@ -1077,6 +1077,7 @@ export function registerTelegramLifecycleRuntimeHooks({ pi, publicationRuntime,
|
|
|
1077
1077
|
agentWorkActive = false;
|
|
1078
1078
|
activityRuntime.onAgentSettled();
|
|
1079
1079
|
modelContextAvailabilityRuntime.reconcile();
|
|
1080
|
+
onSessionSettled?.(ctx);
|
|
1080
1081
|
},
|
|
1081
1082
|
onBeforeAgentStart: Prompts.createTelegramProactiveBeforeAgentStartHook({
|
|
1082
1083
|
reconcileAvailability: modelContextAvailabilityRuntime.reconcile,
|
|
@@ -478,6 +478,13 @@ export default function (pi) {
|
|
|
478
478
|
instanceId: telegramInstanceId,
|
|
479
479
|
listRecords: threadStore.list,
|
|
480
480
|
listWorkspaceBindings: threadStore.listWorkspaceBindings,
|
|
481
|
+
resolveAutomaticDisplayTitle(binding) {
|
|
482
|
+
return ThreadDisplay.resolveTelegramInitialWorkspaceDisplayName({
|
|
483
|
+
bindings: threadStore.listWorkspaceBindings(),
|
|
484
|
+
binding,
|
|
485
|
+
mode: Config.resolveTelegramThreadDisplayMode(configStore.get()),
|
|
486
|
+
});
|
|
487
|
+
},
|
|
481
488
|
getFollowerDisplayTitle: telegramBusFollowerRegistrationState.getDisplayTitle,
|
|
482
489
|
getActiveTurnTarget: activeTurnRuntime.getTarget,
|
|
483
490
|
getFollowerTarget: telegramBusFollowerRegistrationState.getTarget,
|
|
@@ -2440,5 +2447,6 @@ export default function (pi) {
|
|
|
2440
2447
|
},
|
|
2441
2448
|
updateStatus,
|
|
2442
2449
|
recordRuntimeEvent,
|
|
2450
|
+
onSessionSettled: inboundRouteRuntime.onSessionSettled,
|
|
2443
2451
|
});
|
|
2444
2452
|
}
|
|
@@ -57,7 +57,10 @@ export type TelegramLiveRebindCleanupIssue = {
|
|
|
57
57
|
cleanup: ThreadReconciler.TelegramLiveRebindCleanupOutcome;
|
|
58
58
|
recorded: boolean;
|
|
59
59
|
};
|
|
60
|
-
/**
|
|
60
|
+
/**
|
|
61
|
+
* Default live-rebind cleanup pacing: quick early attempts, then minutely, within a 15-minute window. The first
|
|
62
|
+
* delay is not cosmetic: a leader's detached command reply still needs the released, cleanup-free row.
|
|
63
|
+
*/
|
|
61
64
|
export declare const TELEGRAM_LIVE_REBIND_CLEANUP_SCHEDULE: Readonly<{
|
|
62
65
|
delaysMs: readonly number[];
|
|
63
66
|
intervalMs: 60000;
|
|
@@ -100,6 +103,8 @@ export declare function createTelegramLiveRebindCoordinator(input: {
|
|
|
100
103
|
/** Explicit staged singleton command branch; absence preserves ordinary live input behavior. */
|
|
101
104
|
selectedCommand?: Bus.TelegramBusSelectedCommandInput;
|
|
102
105
|
};
|
|
106
|
+
/** Restore moves the tab to its new owner: once applied, show that owner's title (best-effort, never blocking). */
|
|
107
|
+
retitle?: (isCurrent: () => boolean) => Promise<void>;
|
|
103
108
|
recordRuntimeEvent?: (category: string, error: unknown, details: Record<string, unknown>) => void;
|
|
104
109
|
}): {
|
|
105
110
|
/** Correlation only; a later cleanup attempt rereads and revalidates the canonical row itself. */
|
|
@@ -346,6 +351,8 @@ export declare function createTelegramInboundRouteRuntime<TUpdate extends Update
|
|
|
346
351
|
/** Commands-owned registry port for dormant scoped recipient assembly, not ordinary update replay. */
|
|
347
352
|
prepareHeldCommand: ReturnType<typeof Commands.createTelegramCommandHandlerTargetRuntime<TMessage, TContext>>["prepareHeldCommand"];
|
|
348
353
|
canPrepareHeldCommand: ReturnType<typeof Commands.createTelegramCommandHandlerTargetRuntime<TMessage, TContext>>["canPrepareHeldCommand"];
|
|
354
|
+
/** Agent-settled hint: wakes waiting leader cleanup retries early; every readiness gate is still sampled fresh. */
|
|
355
|
+
onSessionSettled(ctx: TContext): void;
|
|
349
356
|
/** Fresh body-free recipient observation only; never reconstructs an attempt or grants cleanup. */
|
|
350
357
|
observeLiveRebindLeaderWork(intent: Threads.TelegramWorkspaceLiveRebindIntent, ctx: TContext): Promise<Bus.TelegramBusLiveRebindWorkObservation | undefined>;
|
|
351
358
|
/** Fresh non-destructive candidate only; no retained idle, cleanup action or deletion grant. */
|