@llblab/pi-kit 0.10.2 → 0.10.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/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  All notable changes to `@llblab/pi-kit` are documented here.
4
4
 
5
+ ## 0.10.3 - 2026-09-11
6
+
7
+ - `State Flow Telegram Surface`: Advances the exact State Flow pin to `0.9.4`, so the pre-Settings section button always carries the spiral identity and the live value (`🌀 State Flow: off`, `🌀 State Flow: #N`), and its submenu repeats that state line, follows it with a short explanation of what State Flow is, and exposes one wide `Start` or `Stop` action instead of Start, Refresh, and Cancel start. The package set, resource inventory, and explicit load order remain unchanged.
8
+
5
9
  ## 0.10.2 - 2026-09-11
6
10
 
7
11
  - `State Flow Publication`: Advances the exact State Flow pin to `0.9.3`, syncing the publication-queue lineage-rewrite hotfix. A queued target orphaned by a reset or re-initialized journal now retargets the live lineage instead of failing every `turn_end`, and deferred remote publication is reported accurately. The package set, resource inventory, and explicit load order remain unchanged.
package/README.md CHANGED
@@ -14,7 +14,7 @@ Package links lead to the owning repositories for usage, documentation, issues,
14
14
  | [`@llblab/pi-clean-room`](https://github.com/llblab/pi-clean-room) | `0.1.1` | Isolated nested Pi TUI with explicitly selected extensions |
15
15
  | [`@llblab/pi-codex-usage`](https://github.com/llblab/pi-codex-usage) | `0.9.4` | Compact Codex/Spark subscription-limit status |
16
16
  | [`@llblab/pi-grow-loop`](https://github.com/llblab/pi-grow-loop) | `0.8.1` | Visible continuation scheduling and bounded worker Skills |
17
- | [`@llblab/pi-state-flow`](https://github.com/llblab/pi-state-flow) | `0.9.3` | Atomic scoped state cohorts with final-eligibility resolution |
17
+ | [`@llblab/pi-state-flow`](https://github.com/llblab/pi-state-flow) | `0.9.4` | Atomic scoped state cohorts with final-eligibility resolution |
18
18
  | [`@llblab/pi-telegram`](https://github.com/llblab/pi-telegram) | `0.45.5` | Telegram companion, queues, files, voice, controls, and Generative Apps guidance |
19
19
  | [`@llblab/skills`](https://github.com/llblab/skills) | `1.15.0` | Portable workflows for engineering, review, design, context maintenance, and other focused tasks |
20
20
 
@@ -2,6 +2,11 @@
2
2
 
3
3
  > Each release keeps at most 8 outcome records of at most 512 characters.
4
4
 
5
+ ## 0.9.4: Telegram submenu mirrors the status line
6
+
7
+ - `Interop`: The section button always carries the spiral identity and the live value — `🌀 State Flow: off` while disabled, `🌀 State Flow: #N` while enabled; the black-circle variant is gone.
8
+ - `Interop`: The submenu header repeats that same state line and follows it with a short explanation of what State Flow is; the only action is one wide `Start` or `Stop` button, with the transport's `⬆️ Main menu` row above it. Refresh and Cancel start are no longer presented, the verbose status block was removed, and their callbacks stay routable for keyboards from earlier versions.
9
+
5
10
  ## 0.9.3: Publication queue lineage-rewrite hotfix
6
11
 
7
12
  - `Publication`: Retarget a queued target orphaned by a journal reset or re-initialization to the live lineage and keep publishing, instead of failing every `turn_end` with "Publication queue targets diverge"; the retired commit stays in local Git history.
@@ -66,7 +66,7 @@ Stopping changes the current session/branch configuration, preserves semantic ch
66
66
 
67
67
  The compact status is an accent `state-flow` and dim `#<step>`. Detailed status distinguishes runtime config/meta from semantic materialization, reports scope keys, the selected temporal head and runtime revision, available hot offsets, per-scope retained patch tails, artifact counts, stale Markdown reasons, and pending publication. Retained tails may include inherited pre-origin records, so their counts are not active history depth. It labels global/CWD/session/effective state without dumping source bodies. Failed inspection means unavailable evidence, never a falsely clean count.
68
68
 
69
- When the optional `pi-telegram` extension is installed, State Flow appears exactly once in Telegram: the inline main menu places a `🌀 State Flow: #N` or `⚫️ State Flow` section button directly before Settings, and that button's label carries the live status. The button opens a compact control submenu for the current session branch: `Start` or `Stop`, `Refresh`, and `Cancel start` while a start deferred behind an active run is pending. Starting while a run is active waits for that run to settle; stopping applies immediately. Registration fails open when the transport is absent, retries when the section registry becomes ready, and disposes on session shutdown; the `/state-flow-*` commands remain the authority and nothing changes for hosts without `pi-telegram`.
69
+ When the optional `pi-telegram` extension is installed, State Flow appears exactly once in Telegram: the inline main menu places a `🌀 State Flow: #N` or `🌀 State Flow: off` section button directly before Settings, and that button's label carries the live status. The button opens a compact submenu whose header repeats the same state line, followed by a short explanation of what State Flow is; the only action is `Start` (or `Stop` while enabled), with the transport-owned `⬆️ Main menu` row above it. Starting while a run is active waits for that run to settle; stopping applies immediately. Registration fails open when the transport is absent, retries when the section registry becomes ready, and disposes on session shutdown; the `/state-flow-*` commands remain the authority and nothing changes for hosts without `pi-telegram`.
70
70
 
71
71
  ## State, scope, and time
72
72
 
@@ -199,7 +199,7 @@ Unknown keys fail loading. State Flow memory ownership and global availability a
199
199
 
200
200
  `/state-flow-status` reports branch mode, runtime revision, temporal head/history depth, scope keys, patch tails, artifact freshness, memory-bearing scopes, external-promotion summaries, remote policy/queue state, and pending publication. Unavailable materialization is reported as unavailable, never fabricated as empty. Artifact source bodies are not read for status.
201
201
 
202
- With `pi-telegram` installed, the optional `telegram` adapter mirrors the same identity in Telegram: the main-menu section button before Settings carries the live `🌀 State Flow: #N` or `⚫️ State Flow` label and opens the branch start/stop submenu. Registration is fail-open and retried on session start, disposal happens on session shutdown, the adapter reads the same snapshot as the compact terminal status, and its start/stop actions call the same functions as the commands.
202
+ With `pi-telegram` installed, the optional `telegram` adapter mirrors the same identity in Telegram: the main-menu section button before Settings carries the live `🌀 State Flow: #N` or `🌀 State Flow: off` label and opens the branch start/stop view, whose header repeats that state line, follows it with a short explanation of what State Flow is, and exposes one wide `Start` or `Stop` action under the transport-owned `⬆️ Main menu` row. Registration is fail-open and retried on session start, disposal happens on session shutdown, the adapter reads the same snapshot as the compact terminal status, and its start/stop actions call the same functions as the commands.
203
203
 
204
204
  Opt-in `logging` appends local JSONL diagnostics for rejected `patch_state` calls and preserved drafts plus fallback turns while turn resolution is pending. A rejected call retains its exact attempted arguments, the precise error, and, when available, tool identity, call id, resolution attempt, and terminal-eligibility state; accepted patches are never logged. Records preserve useful exact text blocks and reduce other blocks to structural identity without duplicating reasoning. They are never semantic state, scope `meta.json`, Pi checkpoints, or repository input. Write failure changes no resolution, enablement, or accepted state and reports at most one bounded local warning.
205
205
 
@@ -73,34 +73,28 @@ export interface StateFlowTelegramAdapter {
73
73
  dispose(): void;
74
74
  }
75
75
 
76
- /** Main-menu section label doubles as the live status value; the disabled row carries no status text. */
76
+ /** Main-menu section label doubles as the live status value: the spiral identity is constant, the value is not. */
77
77
  export function formatStateFlowSectionLabel(snapshot: StateFlowTelegramSnapshot): string {
78
- return snapshot.enabled ? `🌀 State Flow: #${snapshot.step}` : "⚫️ State Flow";
78
+ return snapshot.enabled ? `🌀 State Flow: #${snapshot.step}` : "🌀 State Flow: off";
79
79
  }
80
80
 
81
+ /** Short help under the state line: what State Flow is and why its action button exists. */
82
+ const STATE_FLOW_SECTION_HELP =
83
+ "Durable memory for this conversation: State Flow records the latest accepted state after every turn, so a new session resumes from the last committed point. Start it to keep memory live on this branch, stop it to pause.";
84
+
85
+ /** The submenu header repeats the button's state line; the single action matches the current state. */
81
86
  export function buildStateFlowSectionView(
82
87
  snapshot: StateFlowTelegramSnapshot,
83
88
  callbackData: (action: string) => string,
84
89
  ): StateFlowTelegramView {
85
- const lines = ["<b>🌀 State Flow</b>", ""];
86
- if (snapshot.enabled) {
87
- lines.push("Status: <b>enabled</b>", `State iteration: <code>#${snapshot.step}</code>`);
88
- if (snapshot.bootstrap) lines.push("Bootstrap run: the next completed run migrates active context into state.");
89
- } else if (snapshot.startPending) {
90
- lines.push("Status: <b>off</b>", "Start is pending until the current turn settles.");
91
- } else {
92
- lines.push("Status: <b>off</b>", "State Flow is disabled on this session branch.");
93
- }
94
- const buttons: StateFlowTelegramButton[] = [];
95
- if (snapshot.startPending) {
96
- buttons.push({ text: "✖️ Cancel start", callback_data: callbackData("cancel") });
97
- } else if (snapshot.enabled) {
98
- buttons.push({ text: "⏹ Stop", callback_data: callbackData("stop") });
99
- } else {
100
- buttons.push({ text: "▶️ Start", callback_data: callbackData("start") });
101
- }
102
- buttons.push({ text: "🔄 Refresh", callback_data: callbackData("refresh") });
103
- return { text: lines.join("\n"), parseMode: "html", replyMarkup: { inline_keyboard: [buttons] } };
90
+ const action: StateFlowTelegramButton = snapshot.enabled
91
+ ? { text: "⏹ Stop", callback_data: callbackData("stop") }
92
+ : { text: "▶️ Start", callback_data: callbackData("start") };
93
+ return {
94
+ text: [`<b>${formatStateFlowSectionLabel(snapshot)}</b>`, "", STATE_FLOW_SECTION_HELP].join("\n"),
95
+ parseMode: "html",
96
+ replyMarkup: { inline_keyboard: [[action]] },
97
+ };
104
98
  }
105
99
 
106
100
  function buildStateFlowTelegramSection(port: StateFlowTelegramPort) {
@@ -111,6 +105,7 @@ function buildStateFlowTelegramSection(port: StateFlowTelegramPort) {
111
105
  render: (ctx: StateFlowTelegramSectionContext) =>
112
106
  buildStateFlowSectionView(port.snapshot(), (action) => ctx.callbackData(action)),
113
107
  handleCallback: async (ctx: StateFlowTelegramCallbackContext) => {
108
+ // cancel/refresh remain routable for keyboards sent by earlier versions; 0.9.4 presents only the state action.
114
109
  if (ctx.action !== "start" && ctx.action !== "stop" && ctx.action !== "cancel" && ctx.action !== "refresh") return "pass" as const;
115
110
  let notice: string | undefined;
116
111
  try {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@llblab/pi-state-flow",
3
- "version": "0.9.3",
3
+ "version": "0.9.4",
4
4
  "private": false,
5
5
  "description": "Incremental scoped state/context compiler for Pi, inspired by SKILL.state",
6
6
  "keywords": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@llblab/pi-kit",
3
- "version": "0.10.2",
3
+ "version": "0.10.3",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -44,7 +44,7 @@
44
44
  "@llblab/pi-clean-room": "0.1.1",
45
45
  "@llblab/pi-codex-usage": "0.9.4",
46
46
  "@llblab/pi-grow-loop": "0.8.1",
47
- "@llblab/pi-state-flow": "0.9.3",
47
+ "@llblab/pi-state-flow": "0.9.4",
48
48
  "@llblab/pi-telegram": "0.45.5",
49
49
  "@llblab/skills": "1.15.0"
50
50
  },