@llblab/pi-state-flow 0.26.3 → 0.26.5
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 +8 -0
- package/dist/lib/context.js +2 -1
- package/dist/lib/extension.js +5 -4
- package/dist/package.json +1 -1
- package/docs/architecture.md +1 -1
- package/docs/compatibility.md +1 -1
- package/docs/usage.md +2 -1
- package/lib/context.ts +2 -1
- package/lib/extension.ts +5 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -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.26.5: Telegram Mode Receipt Hotfix
|
|
6
|
+
|
|
7
|
+
- `Telegram mode controls`: Passive now refreshes the selected button on the first accepted click after Off, including existing-memory restoration and write-fence recovery during an active run. Accepted controls retain their renewed presentation receipt instead of being mistaken for canceled work; later mode choices, branch changes and shutdown still suppress obsolete updates. Memory storage and mode semantics are unchanged; no migration is required.
|
|
8
|
+
|
|
9
|
+
## 0.26.4: Passive Compaction Continuity
|
|
10
|
+
|
|
11
|
+
- `Passive continuation`: After idle Stop, native compaction can replace the later user anchor with a summary. Passive now retains that summary, the available tool calls/results and later refinements instead of reducing requests to a frozen handoff. Reload/resume preserve the same continuation; discarded raw history is not reconstructed. Native compaction, memory scopes and stored state are unchanged; no migration or configuration change is required.
|
|
12
|
+
|
|
5
13
|
## 0.26.3: Passive Response Isolation
|
|
6
14
|
|
|
7
15
|
- `Passive context`: Automatic Passive memory heads, Stop handoffs and state-update receipts omit the `response` plane, including after reload and mode changes. Active still sees the previous accepted answer. Canonical response storage, explicit reads and native/user/tool history are unchanged; no migration or configuration change is required.
|
package/dist/lib/context.js
CHANGED
|
@@ -345,7 +345,8 @@ export function passiveContinuationMessages(messages, continuation) {
|
|
|
345
345
|
const trajectory = currentRunTrajectory(messages, "", continuation.activeRunStartedAt);
|
|
346
346
|
return [continuation.handoff, ...trajectory.messages];
|
|
347
347
|
}
|
|
348
|
-
|
|
348
|
+
// A post-stop native summary replaces its compacted user anchor, including the retained tool suffix.
|
|
349
|
+
const start = messages.findIndex((message) => (message.role === "user" || message.role === "compactionSummary")
|
|
349
350
|
&& typeof message.timestamp === "number"
|
|
350
351
|
&& message.timestamp >= continuation.startedAt);
|
|
351
352
|
return [continuation.handoff, ...messages.filter((message, index) => message.role === "custom" || (start >= 0 && index >= start))];
|
package/dist/lib/extension.js
CHANGED
|
@@ -1214,11 +1214,11 @@ export default function stateFlowExtension(pi, options = {}) {
|
|
|
1214
1214
|
});
|
|
1215
1215
|
if (!modePersistenceError) {
|
|
1216
1216
|
appendCheckpoint();
|
|
1217
|
-
return { ok: true, message: `State Flow ${selectedMode}
|
|
1217
|
+
return { ok: true, message: `State Flow ${selectedMode}`, signal: sharedInspectionLifetime.signal };
|
|
1218
1218
|
}
|
|
1219
1219
|
const message = conciseDiagnostic(`State Flow ${selectedMode}; memory writes paused: ${modePersistenceError}`);
|
|
1220
1220
|
notifyProblem(ctx, message, "warning");
|
|
1221
|
-
return { ok: true, message };
|
|
1221
|
+
return { ok: true, message, signal: sharedInspectionLifetime.signal };
|
|
1222
1222
|
};
|
|
1223
1223
|
let accepted = false;
|
|
1224
1224
|
try {
|
|
@@ -1291,10 +1291,11 @@ export default function stateFlowExtension(pi, options = {}) {
|
|
|
1291
1291
|
const operation = selectMode(activeContext, mode);
|
|
1292
1292
|
if (mode === "active")
|
|
1293
1293
|
return operation;
|
|
1294
|
-
//
|
|
1294
|
+
// Native-only outcomes use the selected lifetime; async acceptance may renew and return its own receipt.
|
|
1295
1295
|
const signal = sharedInspectionLifetime.signal;
|
|
1296
1296
|
try {
|
|
1297
|
-
|
|
1297
|
+
const result = await operation;
|
|
1298
|
+
return { ...result, signal: result.signal ?? signal };
|
|
1298
1299
|
}
|
|
1299
1300
|
catch (error) {
|
|
1300
1301
|
return { ok: false, message: diagnosticText(error), signal };
|
package/dist/package.json
CHANGED
package/docs/architecture.md
CHANGED
|
@@ -290,7 +290,7 @@ Which boundary Stop keeps:
|
|
|
290
290
|
|
|
291
291
|
- A recorded active anchor uses the same conservative selector as active inference. If native compaction removed it, or matching is ambiguous or nonfinite, the available native summary and tool trajectory are kept, without guessing a post-stop boundary or rereading discarded raw entries.
|
|
292
292
|
- An interrupted run keeps its captured anchor even after Pi becomes idle. If capture is unavailable, Stop preserves all available context.
|
|
293
|
-
- Completed idle runs, and markers without an active anchor or preservation flag, keep only post-stop conversation plus foreign custom context.
|
|
293
|
+
- Completed idle runs, and markers without an active anchor or preservation flag, keep only post-stop conversation plus foreign custom context. A native `compactionSummary` timestamped at or after Stop is also a continuation boundary: its entire available suffix remains visible through later tool turns and user refinements. Pre-stop summaries do not reopen completed history; no discarded raw request is reconstructed.
|
|
294
294
|
|
|
295
295
|
The initial system prompt is composed at `before_agent_start`. Stop does not rewrite an already-issued request; the next provider request receives the current owned protocol section, as described below.
|
|
296
296
|
|
package/docs/compatibility.md
CHANGED
|
@@ -138,7 +138,7 @@ The optional adapter presents one Off | Passive | Active row and uses the same m
|
|
|
138
138
|
- Inspection returns coherent state plus matching revisions, without publication.
|
|
139
139
|
- Controls and inspections acknowledge callbacks before waiting, suppress revoked results and escape late failures in the current menu.
|
|
140
140
|
- Synchronous mode-selection ports are supported.
|
|
141
|
-
-
|
|
141
|
+
- Passive acceptance returns its current presentation receipt after any internal restoration or lifetime renewal, including existing-memory reacquisition after Off and write-fence recovery. The adapter preserves that accepted receipt, so the first click refreshes the button in both busy and idle sessions. Pre-runtime shared-cache loading also retains its receipt. Later controls, branch changes and shutdown still revoke obsolete presentation, including a change away and back to the same mode while callback acknowledgement waits.
|
|
142
142
|
|
|
143
143
|
Adapter tests establish these contracts with isolated transport fixtures; they are not a live Telegram smoke test. Missing or unready transport remains fail-open and cannot change core memory behavior.
|
|
144
144
|
|
package/docs/usage.md
CHANGED
|
@@ -85,7 +85,7 @@ How each lifecycle event behaves:
|
|
|
85
85
|
- If native split-turn compaction removed the original request anchor, Stop keeps the available summary and tools instead, without reconstructing discarded raw input.
|
|
86
86
|
- An unfinished bootstrap keeps all available native context, or the earlier passive boundary it received. Repeated Start/Stop cannot move that boundary past uncompiled conversation.
|
|
87
87
|
- An interrupted run keeps its captured anchor even after Pi becomes idle, and falls back to all available context when that anchor is unknown.
|
|
88
|
-
- Only Stop after a completed idle run keeps just the later conversation plus foreign custom context. Other extensions' custom context survives in every case.
|
|
88
|
+
- Only Stop after a completed idle run keeps just the later conversation plus foreign custom context. A native compaction summary created after Stop keeps its complete available tool suffix and later refinements, even when the original user anchor is no longer present. Earlier summaries do not reopen completed history. Other extensions' custom context survives in every case.
|
|
89
89
|
- Mid-tool Start and repeated Start/Stop keep the first user event already observed while disabled, so a later Stop does not mistake that busy run for idle.
|
|
90
90
|
- Reload/resume/tree preserve this projection; new or forked physical sessions do not inherit it.
|
|
91
91
|
- Active restart uses the retained projection for one bootstrap run. Off keeps this boundary for a later Passive/Active selection but never projects it.
|
|
@@ -211,6 +211,7 @@ When `pi-telegram` is available, its main-menu section shows `State Flow: active
|
|
|
211
211
|
|
|
212
212
|
- A horizontal radio row presents `Off | Passive | Active`. The selected option uses 🟣, 🟡 or 🟢 respectively; each inactive option uses ⚫️.
|
|
213
213
|
- Telegram Active requested during a run waits for settlement; Passive and Off apply immediately.
|
|
214
|
+
- The first accepted Passive click refreshes the selected button after memory restoration or write-fence recovery, including while the agent is busy. A later mode or branch selection still suppresses an obsolete menu update.
|
|
214
215
|
- Ordinary successful controls add no redundant mode receipt; diagnostic outcomes stay visible.
|
|
215
216
|
- Off exposes neither tool nor State Flow model context.
|
|
216
217
|
|
package/lib/context.ts
CHANGED
|
@@ -329,7 +329,8 @@ export function passiveContinuationMessages(messages: AgentMessage[], continuati
|
|
|
329
329
|
const trajectory = currentRunTrajectory(messages, "", continuation.activeRunStartedAt);
|
|
330
330
|
return [continuation.handoff, ...trajectory.messages];
|
|
331
331
|
}
|
|
332
|
-
|
|
332
|
+
// A post-stop native summary replaces its compacted user anchor, including the retained tool suffix.
|
|
333
|
+
const start = messages.findIndex((message) => (message.role === "user" || message.role === "compactionSummary")
|
|
333
334
|
&& typeof message.timestamp === "number"
|
|
334
335
|
&& message.timestamp >= continuation.startedAt);
|
|
335
336
|
return [continuation.handoff, ...messages.filter((message, index) =>
|
package/lib/extension.ts
CHANGED
|
@@ -1200,11 +1200,11 @@ export default function stateFlowExtension(pi: ExtensionAPI, options: StateFlowE
|
|
|
1200
1200
|
});
|
|
1201
1201
|
if (!modePersistenceError) {
|
|
1202
1202
|
appendCheckpoint();
|
|
1203
|
-
return { ok: true, message: `State Flow ${selectedMode}
|
|
1203
|
+
return { ok: true, message: `State Flow ${selectedMode}`, signal: sharedInspectionLifetime.signal };
|
|
1204
1204
|
}
|
|
1205
1205
|
const message = conciseDiagnostic(`State Flow ${selectedMode}; memory writes paused: ${modePersistenceError}`);
|
|
1206
1206
|
notifyProblem(ctx, message, "warning");
|
|
1207
|
-
return { ok: true, message };
|
|
1207
|
+
return { ok: true, message, signal: sharedInspectionLifetime.signal };
|
|
1208
1208
|
};
|
|
1209
1209
|
let accepted = false;
|
|
1210
1210
|
try {
|
|
@@ -1272,10 +1272,11 @@ export default function stateFlowExtension(pi: ExtensionAPI, options: StateFlowE
|
|
|
1272
1272
|
if (!activeContext) throw new Error("State Flow is not attached to an active session yet");
|
|
1273
1273
|
const operation = selectMode(activeContext, mode);
|
|
1274
1274
|
if (mode === "active") return operation;
|
|
1275
|
-
//
|
|
1275
|
+
// Native-only outcomes use the selected lifetime; async acceptance may renew and return its own receipt.
|
|
1276
1276
|
const signal = sharedInspectionLifetime.signal;
|
|
1277
1277
|
try {
|
|
1278
|
-
|
|
1278
|
+
const result = await operation;
|
|
1279
|
+
return { ...result, signal: result.signal ?? signal };
|
|
1279
1280
|
} catch (error) {
|
|
1280
1281
|
return { ok: false, message: diagnosticText(error), signal };
|
|
1281
1282
|
}
|