opencode-codex-memory 0.12.1 → 0.13.0
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/README.md +2 -2
- package/dist/gui-experimental.cjs +1 -1
- package/dist/src/capture.d.ts +2 -0
- package/dist/src/capture.js +7 -4
- package/dist/src/phase1.d.ts +7 -1
- package/dist/src/phase1.js +48 -14
- package/dist/src/phase2.d.ts +1 -0
- package/dist/src/phase2.js +2 -0
- package/dist/src/pipeline.d.ts +8 -3
- package/dist/src/pipeline.js +12 -9
- package/dist/src/recovery-info.d.ts +24 -0
- package/dist/src/recovery-info.js +26 -0
- package/dist/src/recovery-status.js +1 -0
- package/dist/src/retry.d.ts +12 -8
- package/dist/src/retry.js +99 -20
- package/dist/src/store.d.ts +14 -1
- package/dist/src/store.js +22 -13
- package/dist/src/v2/memory-work.d.ts +8 -0
- package/dist/src/v2/memory-work.js +174 -0
- package/dist/src/v2/panel-messages.d.ts +7 -1
- package/dist/src/v2/panel-messages.js +60 -7
- package/dist/src/v2/panel-status.js +7 -3
- package/dist/src/v2/plugin.js +28 -23
- package/dist/src/v2/status-rpc.d.ts +69 -2
- package/dist/src/v2/status-rpc.js +47 -2
- package/dist/src/v2/status.js +15 -2
- package/dist/src/v2/tools.js +36 -3
- package/dist/src/v2/tui.js +287 -153
- package/dist/tools/control.d.ts +2 -0
- package/dist/tools/control.js +37 -20
- package/package.json +1 -1
package/dist/tools/control.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type ToolDefinition } from "@opencode-ai/plugin";
|
|
2
|
+
import { type MemoryRetryPhase, type MemoryRetryRequest } from "../src/recovery-info.js";
|
|
2
3
|
/**
|
|
3
4
|
* Shared by the memory_reset tool (after user approval) and the OpenCode 2
|
|
4
5
|
* memory panel (whose confirmation is the approval).
|
|
@@ -10,4 +11,5 @@ export declare function performMemoryReset(): {
|
|
|
10
11
|
export declare const memory_reset: ToolDefinition;
|
|
11
12
|
export declare const memory_inspect: ToolDefinition;
|
|
12
13
|
export declare const memory_mode: ToolDefinition;
|
|
14
|
+
export declare function makeMemoryRetryTool(start?: (phase: MemoryRetryPhase, sessionID?: string, all?: boolean) => MemoryRetryRequest): ToolDefinition;
|
|
13
15
|
export declare const memory_retry: ToolDefinition;
|
package/dist/tools/control.js
CHANGED
|
@@ -17,7 +17,7 @@ import { activeProviderCapacityBackoffs } from "../src/ratelimit.js";
|
|
|
17
17
|
import { readMigrationStatus, memoryPipelineSnapshots } from "../src/migration.js";
|
|
18
18
|
import { peekSessionMemoryVersion } from "../src/session-version.js";
|
|
19
19
|
import { withMemoryVersion, writeMemoryVersions } from "../src/memory-version.js";
|
|
20
|
-
import { MEMORY_RETRY_PHASES, modelRecoveryGuidance } from "../src/recovery-info.js";
|
|
20
|
+
import { MEMORY_RETRY_PHASES, modelRecoveryGuidance, retryResultText, } from "../src/recovery-info.js";
|
|
21
21
|
import { recoveryNotices } from "../src/recovery-status.js";
|
|
22
22
|
import { clearMemoryRetryResult, memoryRetryBlockedReason, memoryRetryStatus, requestMemoryRetry, } from "../src/retry.js";
|
|
23
23
|
function isSymlinkedRoot() {
|
|
@@ -279,7 +279,11 @@ function inspectRecovery(writers, now) {
|
|
|
279
279
|
: MEMORY_RETRY_PHASES.filter((phase) => notices.some((notice) => notice.retryPhase === phase));
|
|
280
280
|
const lines = [
|
|
281
281
|
"Recovery:",
|
|
282
|
-
...(latest
|
|
282
|
+
...(latest
|
|
283
|
+
? [
|
|
284
|
+
` Latest ${latest.action === "update" ? "memory update" : `${latest.phase} retry`} (${latest.state}): ${retryResultText(latest)}`,
|
|
285
|
+
]
|
|
286
|
+
: []),
|
|
283
287
|
...notices.map(({ phase, kind, version, detail, sessionID, retryAt }) => {
|
|
284
288
|
const label = `${phase ?? "memory"}${version ? ` (${version})` : ""}${sessionID ? ` for ${sessionID}` : ""}`;
|
|
285
289
|
const error = kind === "provider_capacity"
|
|
@@ -545,21 +549,34 @@ export const memory_mode = tool({
|
|
|
545
549
|
}
|
|
546
550
|
},
|
|
547
551
|
});
|
|
548
|
-
export
|
|
549
|
-
|
|
550
|
-
"
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
}
|
|
564
|
-
|
|
565
|
-
|
|
552
|
+
export function makeMemoryRetryTool(start) {
|
|
553
|
+
return tool({
|
|
554
|
+
description: "On the user's explicit request, retry failed memory extraction or consolidation with current background models. " +
|
|
555
|
+
(start ? "Set all=true only when the user asks to retry all eligible extraction failures. " : "") +
|
|
556
|
+
"This runs only the selected phase and returns its outcome. It skips ordinary failure delays but respects provider " +
|
|
557
|
+
"rate limits, active work, learning settings, and session eligibility. Use memory_inspect to diagnose failures or " +
|
|
558
|
+
"check the latest outcome. Do not keep retrying after a failure or blocked result.",
|
|
559
|
+
args: {
|
|
560
|
+
phase: tool.schema
|
|
561
|
+
.enum(MEMORY_RETRY_PHASES)
|
|
562
|
+
.describe("Retry failed session extraction or a failed memory update."),
|
|
563
|
+
...(start
|
|
564
|
+
? { all: tool.schema.boolean().optional().describe("For extraction, retry each eligible failed job once.") }
|
|
565
|
+
: {}),
|
|
566
|
+
},
|
|
567
|
+
async execute({ phase, all }, ctx) {
|
|
568
|
+
ctx.abort?.throwIfAborted();
|
|
569
|
+
if (all && phase !== "extraction")
|
|
570
|
+
return { output: "Retry all is only available for extraction." };
|
|
571
|
+
const request = start ? start(phase, ctx.sessionID, all === true) : requestMemoryRetry(phase, ctx.sessionID);
|
|
572
|
+
const retry = request.ok
|
|
573
|
+
? await request.completion
|
|
574
|
+
: { phase, state: "blocked", message: request.message };
|
|
575
|
+
return {
|
|
576
|
+
output: `Memory ${retry.phase} retry (${retry.state}): ${start ? retryResultText(retry) : retry.message}`,
|
|
577
|
+
metadata: { retry },
|
|
578
|
+
};
|
|
579
|
+
},
|
|
580
|
+
});
|
|
581
|
+
}
|
|
582
|
+
export const memory_retry = makeMemoryRetryTool();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-codex-memory",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"packageManager": "bun@1.4.4",
|
|
5
5
|
"description": "Persistent memory plugin for opencode — ports codex's two-phase memory system (extraction → consolidation → injection → citation feedback)",
|
|
6
6
|
"type": "module",
|