opencode-immune 1.0.11 → 1.0.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/dist/plugin.js +19 -11
- package/package.json +1 -1
package/dist/plugin.js
CHANGED
|
@@ -531,17 +531,25 @@ function createSessionRecoveryEvent(state) {
|
|
|
531
531
|
*/
|
|
532
532
|
function createSystemTransform(state) {
|
|
533
533
|
return async (input, output) => {
|
|
534
|
-
// Session Recovery injection
|
|
535
|
-
if
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
534
|
+
// Session Recovery injection:
|
|
535
|
+
// Inject if recoveryContext exists AND either:
|
|
536
|
+
// - session is already registered as managed root ultrawork, OR
|
|
537
|
+
// - session is not yet registered (plugin just restarted, map is empty)
|
|
538
|
+
// but agent field matches ultrawork (checked via input metadata if available)
|
|
539
|
+
if (state.recoveryContext) {
|
|
540
|
+
const isManaged = isManagedRootUltraworkSession(state, input.sessionID);
|
|
541
|
+
const mapIsEmpty = state.managedUltraworkSessions.size === 0;
|
|
542
|
+
if (isManaged || mapIsEmpty) {
|
|
543
|
+
const ctx = state.recoveryContext;
|
|
544
|
+
const intentInfo = ctx.intent ? `, Intent: ${ctx.intent}` : "";
|
|
545
|
+
const categoryInfo = ctx.category ? `, Category: ${ctx.category}` : "";
|
|
546
|
+
output.system.push(`[Session Recovery] Active Memory Bank task detected:\n` +
|
|
547
|
+
`- Task: ${ctx.task}\n` +
|
|
548
|
+
`- Level: ${ctx.level}${intentInfo}${categoryInfo}\n` +
|
|
549
|
+
`- Current Phase: ${ctx.phase}\n` +
|
|
550
|
+
`- Phase Status:\n${ctx.phaseStatus}\n` +
|
|
551
|
+
`Read memory-bank/tasks.md and memory-bank/activeContext.md to resume work.`);
|
|
552
|
+
}
|
|
545
553
|
}
|
|
546
554
|
// Ralph Loop injection
|
|
547
555
|
if (state.lastEditAttempt) {
|