opencode-codex-memory 0.12.0 → 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 +8 -1
- package/dist/src/v2/panel-messages.js +93 -15
- package/dist/src/v2/panel-status.d.ts +1 -0
- package/dist/src/v2/panel-status.js +19 -6
- 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 +321 -152
- package/dist/tools/control.d.ts +2 -0
- package/dist/tools/control.js +37 -20
- package/package.json +4 -3
package/dist/src/v2/tui.js
CHANGED
|
@@ -16,6 +16,26 @@ import { createMemo, createSignal as createSignal2, For, Index } from "solid-js"
|
|
|
16
16
|
// src/recovery-info.ts
|
|
17
17
|
var MEMORY_RETRY_PHASES = ["extraction", "consolidation"];
|
|
18
18
|
var MEMORY_RETRY_STATES = ["running", "completed", "blocked", "failed"];
|
|
19
|
+
function retryResultText(retry) {
|
|
20
|
+
const processed = retry.conversationsProcessed;
|
|
21
|
+
const failed = retry.conversationsFailed;
|
|
22
|
+
const skipped = retry.conversationsSkipped;
|
|
23
|
+
return [
|
|
24
|
+
processed ? `${processed} ${processed === 1 ? "conversation" : "conversations"} processed.` : "",
|
|
25
|
+
failed ? `${failed} ${failed === 1 ? "conversation" : "conversations"} still failed.` : "",
|
|
26
|
+
skipped ? `${skipped} ${skipped === 1 ? "conversation was" : "conversations were"} not retried.` : "",
|
|
27
|
+
retry.message
|
|
28
|
+
].filter(Boolean).join(" ");
|
|
29
|
+
}
|
|
30
|
+
function extractionQueueText(queue) {
|
|
31
|
+
if (queue.ready === null)
|
|
32
|
+
return queue.checking ? "Checking which conversations can be retried\u2026" : "Couldn\u2019t check which conversations are ready. Memory will check again on refresh.";
|
|
33
|
+
return [
|
|
34
|
+
`${queue.ready} ready to retry`,
|
|
35
|
+
queue.waitingForIdle ? `${queue.waitingForIdle} waiting to go idle` : "",
|
|
36
|
+
queue.unavailable ? `${queue.unavailable} unavailable or in backoff` : ""
|
|
37
|
+
].filter(Boolean).join(" \xB7 ") + ".";
|
|
38
|
+
}
|
|
19
39
|
var MEMORY_NOTICE_KINDS = [
|
|
20
40
|
"extraction_exhausted",
|
|
21
41
|
"consolidator_setup",
|
|
@@ -123,6 +143,27 @@ var MemoryStatusRpc = {
|
|
|
123
143
|
lastSuccessAt: { type: ["number", "null"] },
|
|
124
144
|
retryAt: { type: ["number", "null"] },
|
|
125
145
|
warnings: { type: "array", items: { type: "string" } },
|
|
146
|
+
extractionBacklog: {
|
|
147
|
+
type: "object",
|
|
148
|
+
properties: {
|
|
149
|
+
count: { type: "integer", minimum: 1 },
|
|
150
|
+
historical: { type: "boolean" }
|
|
151
|
+
},
|
|
152
|
+
required: ["count", "historical"],
|
|
153
|
+
additionalProperties: false
|
|
154
|
+
},
|
|
155
|
+
extractionQueue: {
|
|
156
|
+
type: "object",
|
|
157
|
+
properties: {
|
|
158
|
+
ready: { type: ["integer", "null"], minimum: 0 },
|
|
159
|
+
waitingForIdle: { type: "integer", minimum: 0 },
|
|
160
|
+
unavailable: { type: "integer", minimum: 0 },
|
|
161
|
+
checking: { type: "boolean" },
|
|
162
|
+
multipleBatches: { type: "boolean" }
|
|
163
|
+
},
|
|
164
|
+
required: ["ready", "waitingForIdle", "unavailable"],
|
|
165
|
+
additionalProperties: false
|
|
166
|
+
},
|
|
126
167
|
notices: {
|
|
127
168
|
type: "array",
|
|
128
169
|
items: {
|
|
@@ -134,6 +175,7 @@ var MemoryStatusRpc = {
|
|
|
134
175
|
phase: RETRY_PHASE_SCHEMA,
|
|
135
176
|
sessionID: { type: "string" },
|
|
136
177
|
retryAt: { type: "number" },
|
|
178
|
+
failedAt: { type: "number" },
|
|
137
179
|
retryPhase: RETRY_PHASE_SCHEMA
|
|
138
180
|
},
|
|
139
181
|
required: ["kind"],
|
|
@@ -145,7 +187,11 @@ var MemoryStatusRpc = {
|
|
|
145
187
|
properties: {
|
|
146
188
|
phase: RETRY_PHASE_SCHEMA,
|
|
147
189
|
state: { type: "string", enum: [...MEMORY_RETRY_STATES] },
|
|
148
|
-
message: { type: "string" }
|
|
190
|
+
message: { type: "string" },
|
|
191
|
+
conversationsProcessed: { type: "integer", minimum: 1 },
|
|
192
|
+
conversationsFailed: { type: "integer", minimum: 1 },
|
|
193
|
+
conversationsSkipped: { type: "integer", minimum: 1 },
|
|
194
|
+
action: { type: "string", enum: ["update"] }
|
|
149
195
|
},
|
|
150
196
|
required: ["phase", "state", "message"],
|
|
151
197
|
additionalProperties: false
|
|
@@ -224,7 +270,7 @@ var MemoryStatusRpc = {
|
|
|
224
270
|
retryFailed: {
|
|
225
271
|
input: {
|
|
226
272
|
type: "object",
|
|
227
|
-
properties: { phase: RETRY_PHASE_SCHEMA },
|
|
273
|
+
properties: { phase: RETRY_PHASE_SCHEMA, all: { type: "boolean" } },
|
|
228
274
|
required: ["phase"],
|
|
229
275
|
additionalProperties: false
|
|
230
276
|
},
|
|
@@ -297,10 +343,16 @@ function isMemoryStatus(value) {
|
|
|
297
343
|
if (!Array.isArray(value.warnings) || !value.warnings.every((w) => typeof w === "string")) {
|
|
298
344
|
return false;
|
|
299
345
|
}
|
|
300
|
-
if (value.notices !== undefined && (!Array.isArray(value.notices) || !value.notices.every((notice) => isRecord(notice) && typeof notice.kind === "string" && MEMORY_NOTICE_KINDS.includes(notice.kind) && (notice.version === undefined || notice.version === "v1" || notice.version === "v2") && (notice.phase === undefined || isMemoryRetryPhase(notice.phase)) && (notice.detail === undefined || typeof notice.detail === "string") && (notice.sessionID === undefined || typeof notice.sessionID === "string") && (notice.retryPhase === undefined || isMemoryRetryPhase(notice.retryPhase)) && (notice.retryAt === undefined || typeof notice.retryAt === "number" && Number.isFinite(notice.retryAt)))))
|
|
346
|
+
if (value.notices !== undefined && (!Array.isArray(value.notices) || !value.notices.every((notice) => isRecord(notice) && typeof notice.kind === "string" && MEMORY_NOTICE_KINDS.includes(notice.kind) && (notice.version === undefined || notice.version === "v1" || notice.version === "v2") && (notice.phase === undefined || isMemoryRetryPhase(notice.phase)) && (notice.detail === undefined || typeof notice.detail === "string") && (notice.sessionID === undefined || typeof notice.sessionID === "string") && (notice.retryPhase === undefined || isMemoryRetryPhase(notice.retryPhase)) && (notice.failedAt === undefined || typeof notice.failedAt === "number" && Number.isFinite(notice.failedAt)) && (notice.retryAt === undefined || typeof notice.retryAt === "number" && Number.isFinite(notice.retryAt)))))
|
|
347
|
+
return false;
|
|
348
|
+
const backlog = value.extractionBacklog;
|
|
349
|
+
if (backlog !== undefined && (!isRecord(backlog) || !Number.isInteger(backlog.count) || backlog.count < 1 || typeof backlog.historical !== "boolean"))
|
|
301
350
|
return false;
|
|
302
351
|
const retry = value.manualRetry;
|
|
303
|
-
if (retry != null && (!isRecord(retry) || !isMemoryRetryPhase(retry.phase) || typeof retry.message !== "string" || !MEMORY_RETRY_STATES.includes(retry.state)))
|
|
352
|
+
if (retry != null && (!isRecord(retry) || !isMemoryRetryPhase(retry.phase) || typeof retry.message !== "string" || !MEMORY_RETRY_STATES.includes(retry.state) || retry.action !== undefined && retry.action !== "update" || ![retry.conversationsProcessed, retry.conversationsFailed, retry.conversationsSkipped].every((count) => count === undefined || Number.isInteger(count) && count >= 1)))
|
|
353
|
+
return false;
|
|
354
|
+
const queue = value.extractionQueue;
|
|
355
|
+
if (queue !== undefined && (!isRecord(queue) || ![queue.waitingForIdle, queue.unavailable].every((count) => Number.isInteger(count) && count >= 0) || queue.ready !== null && (!Number.isInteger(queue.ready) || queue.ready < 0) || queue.checking !== undefined && typeof queue.checking !== "boolean" || queue.multipleBatches !== undefined && typeof queue.multipleBatches !== "boolean"))
|
|
304
356
|
return false;
|
|
305
357
|
if (value.sessionMode !== null && value.sessionMode !== "enabled" && value.sessionMode !== "disabled" && value.sessionMode !== "polluted") {
|
|
306
358
|
return false;
|
|
@@ -343,8 +395,10 @@ function watchMemoryStatus(read, subscribe) {
|
|
|
343
395
|
const next = await read(AbortSignal.any([lifetime.signal, AbortSignal.timeout(5000)]));
|
|
344
396
|
if (lifetime.signal.aborted || request !== revision)
|
|
345
397
|
return;
|
|
346
|
-
if (!isMemoryStatus(next))
|
|
347
|
-
|
|
398
|
+
if (!isMemoryStatus(next)) {
|
|
399
|
+
setUnavailable(true);
|
|
400
|
+
return;
|
|
401
|
+
}
|
|
348
402
|
setStatus(next);
|
|
349
403
|
setUpdatedAt(Date.now());
|
|
350
404
|
setUnavailable(false);
|
|
@@ -369,8 +423,22 @@ function watchMemoryStatus(read, subscribe) {
|
|
|
369
423
|
function hasConsolidationLease(pipeline, now) {
|
|
370
424
|
return pipeline.phase2Status === "running" && (pipeline.phase2LeaseUntil == null || pipeline.phase2LeaseUntil > now);
|
|
371
425
|
}
|
|
426
|
+
function activeMemoryWork(status, now) {
|
|
427
|
+
if (status.manualRetry?.state === "running" && status.manualRetry.action !== "update")
|
|
428
|
+
return "retry";
|
|
429
|
+
if (status.activity === "consolidating")
|
|
430
|
+
return "consolidation";
|
|
431
|
+
if (status.activity === "extracting")
|
|
432
|
+
return "extraction";
|
|
433
|
+
if (status.manualRetry?.state === "running")
|
|
434
|
+
return "consolidation";
|
|
435
|
+
if (status.pipelines.some((pipeline) => hasConsolidationLease(pipeline, now)))
|
|
436
|
+
return "consolidation";
|
|
437
|
+
if (status.pipelines.some((pipeline) => pipeline.extracting > 0))
|
|
438
|
+
return "extraction";
|
|
439
|
+
}
|
|
372
440
|
function isMemoryRunning(status, now = Date.now()) {
|
|
373
|
-
return status
|
|
441
|
+
return activeMemoryWork(status, now) !== undefined;
|
|
374
442
|
}
|
|
375
443
|
function elapsed(time, now) {
|
|
376
444
|
const minutes = Math.max(0, Math.floor((now - time) / 60000));
|
|
@@ -483,7 +551,6 @@ function configRows(s) {
|
|
|
483
551
|
{ label: "Location", value: s.memoryRoot }
|
|
484
552
|
];
|
|
485
553
|
}
|
|
486
|
-
|
|
487
554
|
// src/v2/panel-messages.ts
|
|
488
555
|
var memoryHelp = {
|
|
489
556
|
models: { label: "Background model setup", path: "configuration.md#choose-background-models" },
|
|
@@ -502,20 +569,57 @@ var retryLabels = {
|
|
|
502
569
|
extraction: { action: "Retry extraction", result: "Extraction retry" },
|
|
503
570
|
consolidation: { action: "Retry consolidation", result: "Consolidation retry" }
|
|
504
571
|
};
|
|
572
|
+
function retryActionLabel(phase, status) {
|
|
573
|
+
return phase === "extraction" && status?.extractionBacklog?.historical ? "Retry next batch" : retryLabels[phase].action;
|
|
574
|
+
}
|
|
575
|
+
function retryResultLabel(retry) {
|
|
576
|
+
return retry.action === "update" ? "Memory update" : retryLabels[retry.phase].result;
|
|
577
|
+
}
|
|
578
|
+
function retryAllLabel(status) {
|
|
579
|
+
const queue = status?.extractionQueue;
|
|
580
|
+
if (queue?.multipleBatches && queue.ready)
|
|
581
|
+
return `Retry all eligible (${queue.ready})`;
|
|
582
|
+
}
|
|
583
|
+
function extractionRetryUnavailable(status) {
|
|
584
|
+
const queue = status?.extractionQueue;
|
|
585
|
+
return !!queue && !queue.ready;
|
|
586
|
+
}
|
|
587
|
+
function noticeDetail(notice) {
|
|
588
|
+
const version = notice.version ? `${notice.version.toUpperCase()}: ` : "";
|
|
589
|
+
const date = notice.failedAt === undefined ? "" : `${new Date(notice.failedAt).toLocaleString()} \xB7 `;
|
|
590
|
+
return `${version}${date}${notice.detail ?? ""}`;
|
|
591
|
+
}
|
|
592
|
+
var retryWaitMessages = {
|
|
593
|
+
retry: "A memory retry is already running. Wait for it to finish.",
|
|
594
|
+
consolidation: "A background memory update is running. You can retry when it finishes.",
|
|
595
|
+
extraction: "Memory is learning from sessions. You can retry when that finishes."
|
|
596
|
+
};
|
|
505
597
|
function retryDescription(times, now) {
|
|
506
598
|
return times.every((time) => time > now) ? `Automatic retry can run ${remaining(Math.min(...times), now)}, when there\u2019s OpenCode activity.` : "Automatic retry can run on the next OpenCode activity.";
|
|
507
599
|
}
|
|
508
|
-
function noticeMessage(kind, details, now,
|
|
600
|
+
function noticeMessage(kind, details, now, offersRetry, retryBlockedReason, status, sessionID) {
|
|
601
|
+
const canRetry = offersRetry && !retryBlockedReason;
|
|
509
602
|
switch (kind) {
|
|
510
603
|
case "extraction_exhausted": {
|
|
511
604
|
const current = sessionID ? details.find((notice) => notice.sessionID === sessionID) : undefined;
|
|
512
605
|
const affected = current ?? details[0];
|
|
606
|
+
const backlog = status.extractionBacklog;
|
|
607
|
+
if (backlog?.historical) {
|
|
608
|
+
const count = backlog.count;
|
|
609
|
+
const remaining = count === 1 ? "1 conversation still has an earlier failure." : `${count} conversations still have earlier failures.`;
|
|
610
|
+
return {
|
|
611
|
+
title: "Earlier extraction failures",
|
|
612
|
+
description: `${remaining} Memory has processed other conversations since then.${canRetry ? " You can retry in batches." : ""}`,
|
|
613
|
+
affectedSessionID: current ? undefined : affected?.sessionID,
|
|
614
|
+
details
|
|
615
|
+
};
|
|
616
|
+
}
|
|
513
617
|
const recovery = modelRecoveryGuidance(details.filter((notice) => notice.sessionID === affected?.sessionID).map((notice) => notice.detail ?? ""), "extraction");
|
|
514
618
|
const conversation = current ? "this conversation" : "an affected conversation";
|
|
515
|
-
const nextStep =
|
|
619
|
+
const nextStep = canRetry ? "Retry a batch with the current background models. No new message is needed." : offersRetry ? undefined : status.manualRetry !== undefined ? "Wait for the provider limit to clear before retrying." : `After fixing the issue, send a new message in ${conversation} and let it go idle.`;
|
|
516
620
|
return {
|
|
517
621
|
title: "Learning stopped for some sessions",
|
|
518
|
-
description:
|
|
622
|
+
description: [recovery?.description ?? "Some conversations ran out of retries.", nextStep].filter(Boolean).join(" "),
|
|
519
623
|
help: recovery?.help ?? "troubleshooting",
|
|
520
624
|
warning: true,
|
|
521
625
|
affectedSessionID: current ? undefined : affected?.sessionID,
|
|
@@ -531,11 +635,11 @@ function noticeMessage(kind, details, now, retryPhases, supportsRetry, sessionID
|
|
|
531
635
|
const waiting = times.every((time) => time > now);
|
|
532
636
|
const retry = retryDescription(times, now);
|
|
533
637
|
return {
|
|
534
|
-
title: recovery ? `${phase} failed` : waiting ? `${phase} waiting to retry` : `${phase} can retry`,
|
|
638
|
+
title: recovery || retryBlockedReason ? `${phase} failed` : waiting ? `${phase} waiting to retry` : `${phase} can retry`,
|
|
535
639
|
description: [
|
|
536
640
|
recovery?.description ?? (extraction ? "Learning from some sessions failed." : "The last memory update failed."),
|
|
537
|
-
retry,
|
|
538
|
-
|
|
641
|
+
offersRetry && retryBlockedReason ? "" : retry,
|
|
642
|
+
canRetry ? "You can retry now with the current models." : ""
|
|
539
643
|
].filter(Boolean).join(" "),
|
|
540
644
|
help: recovery?.help ?? (extraction ? undefined : "troubleshooting"),
|
|
541
645
|
warning: !!recovery,
|
|
@@ -545,7 +649,7 @@ function noticeMessage(kind, details, now, retryPhases, supportsRetry, sessionID
|
|
|
545
649
|
case "provider_capacity":
|
|
546
650
|
return {
|
|
547
651
|
title: "Provider rate limit or quota",
|
|
548
|
-
description: details.every((notice) => (notice.retryAt ?? 0) > now) ? retryDescription(details.map((notice) => notice.retryAt ?? 0), now) :
|
|
652
|
+
description: details.every((notice) => (notice.retryAt ?? 0) > now) ? retryDescription(details.map((notice) => notice.retryAt ?? 0), now) : canRetry ? "If the provider allows requests again, retry with the current background models." : "Learning can resume when the provider allows requests again.",
|
|
549
653
|
help: "backup",
|
|
550
654
|
details
|
|
551
655
|
};
|
|
@@ -586,6 +690,15 @@ function noticeMessage(kind, details, now, retryPhases, supportsRetry, sessionID
|
|
|
586
690
|
function memoryMessages(status, now, sessionID) {
|
|
587
691
|
if (status.activity === "stopping")
|
|
588
692
|
return [{ title: "Memory is stopping", description: "Wait for OpenCode to reconnect." }];
|
|
693
|
+
const work = activeMemoryWork(status, now);
|
|
694
|
+
if (!status.generateMemories && work)
|
|
695
|
+
return [
|
|
696
|
+
{
|
|
697
|
+
title: "Pausing learning",
|
|
698
|
+
description: "Current memory work is finishing. No new batches or consolidation will start."
|
|
699
|
+
}
|
|
700
|
+
];
|
|
701
|
+
const retryBlockedReason = !status.generateMemories ? "Turn on Learn from sessions to retry." : work ? retryWaitMessages[work] : undefined;
|
|
589
702
|
const shownRetries = new Set;
|
|
590
703
|
const messages = MEMORY_NOTICE_KINDS.flatMap((kind) => {
|
|
591
704
|
const notices = status.notices?.filter((notice) => notice.kind === kind) ?? [];
|
|
@@ -600,12 +713,27 @@ function memoryMessages(status, now, sessionID) {
|
|
|
600
713
|
shownRetries.add(retryPhase);
|
|
601
714
|
}
|
|
602
715
|
}
|
|
716
|
+
const offersRetry = retryPhases.length > 0;
|
|
717
|
+
const queue = retryPhases.includes("extraction") ? status.extractionQueue : undefined;
|
|
718
|
+
const blocked = retryBlockedReason ?? (queue && !queue.ready ? extractionQueueText(queue) : undefined);
|
|
719
|
+
const message = noticeMessage(kind, notices, now, offersRetry, blocked, status, sessionID);
|
|
603
720
|
return [
|
|
604
|
-
{
|
|
721
|
+
{
|
|
722
|
+
...message,
|
|
723
|
+
description: queue?.ready ? `${message.description} ${extractionQueueText(queue)}` : message.description,
|
|
724
|
+
retryPhases,
|
|
725
|
+
retryBlockedReason: offersRetry ? blocked : undefined
|
|
726
|
+
}
|
|
605
727
|
];
|
|
606
728
|
});
|
|
607
729
|
if (status.manualRetry?.state === "running")
|
|
608
|
-
return [
|
|
730
|
+
return [
|
|
731
|
+
{
|
|
732
|
+
title: status.manualRetry.action === "update" ? "Updating memory\u2026" : `Retrying ${status.manualRetry.phase}\u2026`,
|
|
733
|
+
description: status.manualRetry.message
|
|
734
|
+
},
|
|
735
|
+
...messages
|
|
736
|
+
];
|
|
609
737
|
if (status.generateMemories) {
|
|
610
738
|
const active = status.pipelines.filter((pipeline) => status.dualWrite || pipeline.version === status.version);
|
|
611
739
|
if (status.activity === "consolidating") {
|
|
@@ -758,21 +886,26 @@ function MemoryDialog(context, sessionID) {
|
|
|
758
886
|
const snapshot = status();
|
|
759
887
|
return busy() !== null || !snapshot?.generateMemories || snapshot.activity === "stopping" || isMemoryRunning(snapshot, updatedAt());
|
|
760
888
|
};
|
|
761
|
-
const canRetry = (phase) => !retryDisabled() && messages().some((message) => message.retryPhases?.includes(phase));
|
|
889
|
+
const canRetry = (phase) => !retryDisabled() && (phase !== "extraction" || !extractionRetryUnavailable(status())) && messages().some((message) => message.retryPhases?.includes(phase));
|
|
890
|
+
const canRetryAll = () => canRetry("extraction") && !!retryAllLabel(status());
|
|
762
891
|
const needsProvider = () => messages().some((message) => message.help === "providers");
|
|
763
892
|
const affectedSession = () => messages().find((message) => message.affectedSessionID)?.affectedSessionID;
|
|
764
893
|
const diagnostics = createMemo(() => {
|
|
765
894
|
const snapshot = status();
|
|
766
|
-
return snapshot?.notices === undefined || unavailable() ? snapshot?.warnings ?? [] : messages().flatMap((message) => (message.details ?? []).
|
|
767
|
-
detail,
|
|
768
|
-
version
|
|
769
|
-
}) => detail ? [`${version ? `${version.toUpperCase()}: ` : ""}${detail}`] : []));
|
|
895
|
+
return snapshot?.notices === undefined || unavailable() ? snapshot?.warnings ?? [] : messages().flatMap((message) => (message.details ?? []).filter((entry) => entry.detail).map(noticeDetail));
|
|
770
896
|
});
|
|
771
897
|
const call = async (id, method, input, done) => {
|
|
772
898
|
if (busy() || unavailable() || status()?.activity === "stopping")
|
|
773
899
|
return;
|
|
774
900
|
setBusy(id);
|
|
775
901
|
setNotice(null);
|
|
902
|
+
const reportFailure = (description) => {
|
|
903
|
+
const label = method === "retryFailed" ? "Couldn\u2019t start retry" : "Failed";
|
|
904
|
+
setNotice({
|
|
905
|
+
message: `${label}: ${description}`,
|
|
906
|
+
tone: "error"
|
|
907
|
+
});
|
|
908
|
+
};
|
|
776
909
|
try {
|
|
777
910
|
const result = await rpc[method](input, {
|
|
778
911
|
location: context.location ?? context.data.location.default(),
|
|
@@ -782,33 +915,32 @@ function MemoryDialog(context, sessionID) {
|
|
|
782
915
|
return;
|
|
783
916
|
const reply = result;
|
|
784
917
|
if (method === "consolidateNow" ? reply?.status !== "started" : reply?.ok !== true) {
|
|
785
|
-
|
|
786
|
-
}
|
|
787
|
-
if (done)
|
|
918
|
+
reportFailure(reply?.message ?? "The server did not apply the request. Refresh and try again.");
|
|
919
|
+
} else if (done) {
|
|
788
920
|
setNotice({
|
|
789
921
|
message: done,
|
|
790
922
|
tone: "ok"
|
|
791
923
|
});
|
|
924
|
+
}
|
|
792
925
|
await refresh();
|
|
793
926
|
} catch (error) {
|
|
794
927
|
if (signal.aborted)
|
|
795
928
|
return;
|
|
796
|
-
|
|
797
|
-
setNotice({
|
|
798
|
-
message: `${label}: ${error instanceof Error ? error.message : String(error)}`,
|
|
799
|
-
tone: "error"
|
|
800
|
-
});
|
|
929
|
+
reportFailure(error instanceof Error ? error.message : String(error));
|
|
801
930
|
await refresh();
|
|
802
931
|
} finally {
|
|
803
932
|
if (!signal.aborted)
|
|
804
933
|
setBusy(null);
|
|
805
934
|
}
|
|
806
935
|
};
|
|
807
|
-
const startRetry = (phase) => {
|
|
808
|
-
if (!canRetry(phase))
|
|
936
|
+
const startRetry = (phase, all = false) => {
|
|
937
|
+
if (all ? !canRetryAll() : !canRetry(phase))
|
|
809
938
|
return;
|
|
810
939
|
scroll?.scrollTo(0);
|
|
811
|
-
call("retry", "retryFailed", {
|
|
940
|
+
call("retry", "retryFailed", all ? {
|
|
941
|
+
phase,
|
|
942
|
+
all
|
|
943
|
+
} : {
|
|
812
944
|
phase
|
|
813
945
|
});
|
|
814
946
|
};
|
|
@@ -849,7 +981,7 @@ function MemoryDialog(context, sessionID) {
|
|
|
849
981
|
run: () => void call("learn", "setOption", {
|
|
850
982
|
key: "generate_memories",
|
|
851
983
|
value: !s.generateMemories
|
|
852
|
-
}, s.generateMemories ? "Learning paused." : "Learning resumed.")
|
|
984
|
+
}, s.generateMemories ? isMemoryRunning(s, updatedAt()) ? "Pausing after current memory work." : "Learning paused." : "Learning resumed.")
|
|
853
985
|
}];
|
|
854
986
|
if (sessionID) {
|
|
855
987
|
const learning = s.sessionMode !== "disabled" && s.sessionMode !== "polluted";
|
|
@@ -866,12 +998,13 @@ function MemoryDialog(context, sessionID) {
|
|
|
866
998
|
});
|
|
867
999
|
}
|
|
868
1000
|
const running = isMemoryRunning(s, updatedAt());
|
|
1001
|
+
const update = s.manualRetry?.action === "update" ? s.manualRetry : undefined;
|
|
869
1002
|
list.push({
|
|
870
1003
|
id: "now",
|
|
871
1004
|
title: "Consolidate now",
|
|
872
|
-
hint: running ? "Already running. Progress appears in Overview." : s.activity === "stopping" ? "The memory service is stopping." : s.generateMemories ? "Process eligible sessions now, bypassing the consolidation cooldown." : "Turn on Learn from sessions first.",
|
|
1005
|
+
hint: update ? `${retryResultLabel(update)}: ${retryResultText(update)}` : running ? "Already running. Progress appears in Overview." : s.activity === "stopping" ? "The memory service is stopping." : s.generateMemories ? "Process eligible sessions now, bypassing the consolidation cooldown." : "Turn on Learn from sessions first.",
|
|
873
1006
|
enabled: s.generateMemories && !running && s.activity !== "stopping",
|
|
874
|
-
run: () => void call("now", "consolidateNow", {}
|
|
1007
|
+
run: () => void call("now", "consolidateNow", {})
|
|
875
1008
|
});
|
|
876
1009
|
list.push({
|
|
877
1010
|
id: "reset",
|
|
@@ -957,7 +1090,7 @@ function MemoryDialog(context, sessionID) {
|
|
|
957
1090
|
event.stopPropagation();
|
|
958
1091
|
action();
|
|
959
1092
|
};
|
|
960
|
-
const retryShortcuts = () => RETRY_PHASES.filter(canRetry).map((phase) => `${RETRY_KEYS[phase]}
|
|
1093
|
+
const retryShortcuts = () => RETRY_PHASES.filter(canRetry).map((phase) => `${RETRY_KEYS[phase]} ${retryActionLabel(phase, status()).toLowerCase()}`).concat(canRetryAll() ? ["a retry all"] : []).join(" \xB7 ");
|
|
961
1094
|
context.keymap.layer(() => ({
|
|
962
1095
|
mode: "modal",
|
|
963
1096
|
commands: [...["left", "shift+tab"].map((bind) => ({
|
|
@@ -1003,11 +1136,16 @@ function MemoryDialog(context, sessionID) {
|
|
|
1003
1136
|
refresh();
|
|
1004
1137
|
}
|
|
1005
1138
|
}, ...RETRY_PHASES.map((phase) => ({
|
|
1006
|
-
title:
|
|
1139
|
+
title: retryActionLabel(phase, status()),
|
|
1007
1140
|
bind: RETRY_KEYS[phase],
|
|
1008
1141
|
enabled: () => tab() === "Overview" && canRetry(phase),
|
|
1009
1142
|
run: () => startRetry(phase)
|
|
1010
1143
|
})), {
|
|
1144
|
+
title: "Retry all eligible conversations",
|
|
1145
|
+
bind: "a",
|
|
1146
|
+
enabled: () => tab() === "Overview" && canRetryAll(),
|
|
1147
|
+
run: () => startRetry("extraction", true)
|
|
1148
|
+
}, {
|
|
1011
1149
|
title: memoryHelp.providers.label,
|
|
1012
1150
|
bind: "p",
|
|
1013
1151
|
enabled: () => tab() === "Overview" && needsProvider(),
|
|
@@ -1188,7 +1326,7 @@ function MemoryDialog(context, sessionID) {
|
|
|
1188
1326
|
return _$memo(() => retryResult().state === "completed")() ? color.ok : color.warn;
|
|
1189
1327
|
},
|
|
1190
1328
|
get children() {
|
|
1191
|
-
return `${
|
|
1329
|
+
return `${retryResultLabel(retryResult())}: ${retryResultText(retryResult())}`;
|
|
1192
1330
|
}
|
|
1193
1331
|
}) : _$createElement("box");
|
|
1194
1332
|
})(), null);
|
|
@@ -1216,10 +1354,10 @@ function MemoryDialog(context, sessionID) {
|
|
|
1216
1354
|
var _el$35 = _$createElement("text");
|
|
1217
1355
|
_$setProp(_el$35, "wrapMode", "word");
|
|
1218
1356
|
_$insert(_el$35, (() => {
|
|
1219
|
-
var _c$
|
|
1220
|
-
return () => _c$
|
|
1357
|
+
var _c$11 = _$memo(() => !!canRetry(phase));
|
|
1358
|
+
return () => _c$11() ? `[${RETRY_KEYS[phase]}] ` : "";
|
|
1221
1359
|
})(), null);
|
|
1222
|
-
_$insert(_el$35, () =>
|
|
1360
|
+
_$insert(_el$35, () => retryActionLabel(phase, status()), null);
|
|
1223
1361
|
_$insert(_el$35, () => canRetry(phase) ? "" : " (unavailable)", null);
|
|
1224
1362
|
_$effect((_p$) => {
|
|
1225
1363
|
var _v$16 = canRetry(phase) ? color.text : color.muted, _v$17 = click(() => startRetry(phase));
|
|
@@ -1234,13 +1372,14 @@ function MemoryDialog(context, sessionID) {
|
|
|
1234
1372
|
})()
|
|
1235
1373
|
}), null);
|
|
1236
1374
|
_$insert(_el$31, (() => {
|
|
1237
|
-
var _c$9 = _$memo(() => message().
|
|
1375
|
+
var _c$9 = _$memo(() => !!(message().retryPhases?.includes("extraction") && retryAllLabel(status())));
|
|
1238
1376
|
return () => _c$9() ? (() => {
|
|
1239
|
-
var _el$36 = _$createElement("text")
|
|
1240
|
-
_$
|
|
1241
|
-
_$insert(_el$36, () =>
|
|
1377
|
+
var _el$36 = _$createElement("text");
|
|
1378
|
+
_$setProp(_el$36, "wrapMode", "word");
|
|
1379
|
+
_$insert(_el$36, () => canRetryAll() ? "[a] " : "", null);
|
|
1380
|
+
_$insert(_el$36, () => retryAllLabel(status()), null);
|
|
1242
1381
|
_$effect((_p$) => {
|
|
1243
|
-
var _v$18 = color.text, _v$19 = click(
|
|
1382
|
+
var _v$18 = canRetryAll() ? color.text : color.muted, _v$19 = click(() => startRetry("extraction", true));
|
|
1244
1383
|
_v$18 !== _p$.e && (_p$.e = _$setProp(_el$36, "fg", _v$18, _p$.e));
|
|
1245
1384
|
_v$19 !== _p$.t && (_p$.t = _$setProp(_el$36, "onMouseUp", _v$19, _p$.t));
|
|
1246
1385
|
return _p$;
|
|
@@ -1249,38 +1388,66 @@ function MemoryDialog(context, sessionID) {
|
|
|
1249
1388
|
t: undefined
|
|
1250
1389
|
});
|
|
1251
1390
|
return _el$36;
|
|
1252
|
-
})() : _$
|
|
1253
|
-
|
|
1254
|
-
|
|
1391
|
+
})() : _$createElement("box");
|
|
1392
|
+
})(), null);
|
|
1393
|
+
_$insert(_el$31, (() => {
|
|
1394
|
+
var _c$0 = _$memo(() => !!message().retryBlockedReason);
|
|
1395
|
+
return () => _c$0() ? (() => {
|
|
1396
|
+
var _el$38 = _$createElement("text");
|
|
1255
1397
|
_$setProp(_el$38, "wrapMode", "word");
|
|
1256
|
-
_$insert(_el$
|
|
1398
|
+
_$insert(_el$38, () => message().retryBlockedReason);
|
|
1399
|
+
_$effect((_$p) => _$setProp(_el$38, "fg", color.muted, _$p));
|
|
1400
|
+
return _el$38;
|
|
1401
|
+
})() : _$createElement("box");
|
|
1402
|
+
})(), null);
|
|
1403
|
+
_$insert(_el$31, (() => {
|
|
1404
|
+
var _c$1 = _$memo(() => message().help === "providers");
|
|
1405
|
+
return () => _c$1() ? (() => {
|
|
1406
|
+
var _el$40 = _$createElement("text"), _el$41 = _$createTextNode(`[p] `);
|
|
1407
|
+
_$insertNode(_el$40, _el$41);
|
|
1408
|
+
_$insert(_el$40, () => memoryHelp.providers.label, null);
|
|
1257
1409
|
_$effect((_p$) => {
|
|
1258
|
-
var _v$20 = color.text, _v$21 =
|
|
1259
|
-
_v$20 !== _p$.e && (_p$.e = _$setProp(_el$
|
|
1260
|
-
_v$21 !== _p$.t && (_p$.t = _$setProp(_el$
|
|
1410
|
+
var _v$20 = color.text, _v$21 = click(openProviders);
|
|
1411
|
+
_v$20 !== _p$.e && (_p$.e = _$setProp(_el$40, "fg", _v$20, _p$.e));
|
|
1412
|
+
_v$21 !== _p$.t && (_p$.t = _$setProp(_el$40, "onMouseUp", _v$21, _p$.t));
|
|
1261
1413
|
return _p$;
|
|
1262
1414
|
}, {
|
|
1263
1415
|
e: undefined,
|
|
1264
1416
|
t: undefined
|
|
1265
1417
|
});
|
|
1266
|
-
return _el$
|
|
1418
|
+
return _el$40;
|
|
1419
|
+
})() : _$memo(() => !!message().help)() ? (() => {
|
|
1420
|
+
var _el$42 = _$createElement("text"), _el$43 = _$createElement("a");
|
|
1421
|
+
_$insertNode(_el$42, _el$43);
|
|
1422
|
+
_$setProp(_el$42, "wrapMode", "word");
|
|
1423
|
+
_$insert(_el$43, () => memoryHelp[message().help].label);
|
|
1424
|
+
_$effect((_p$) => {
|
|
1425
|
+
var _v$22 = color.text, _v$23 = memoryHelpURL(message().help);
|
|
1426
|
+
_v$22 !== _p$.e && (_p$.e = _$setProp(_el$42, "fg", _v$22, _p$.e));
|
|
1427
|
+
_v$23 !== _p$.t && (_p$.t = _$setProp(_el$43, "href", _v$23, _p$.t));
|
|
1428
|
+
return _p$;
|
|
1429
|
+
}, {
|
|
1430
|
+
e: undefined,
|
|
1431
|
+
t: undefined
|
|
1432
|
+
});
|
|
1433
|
+
return _el$42;
|
|
1267
1434
|
})() : _$createElement("box");
|
|
1268
1435
|
})(), null);
|
|
1269
1436
|
_$insert(_el$31, (() => {
|
|
1270
|
-
var _c$
|
|
1271
|
-
return () => _c$
|
|
1272
|
-
var _el$
|
|
1273
|
-
_$insertNode(_el$
|
|
1437
|
+
var _c$10 = _$memo(() => !!message().affectedSessionID);
|
|
1438
|
+
return () => _c$10() ? (() => {
|
|
1439
|
+
var _el$45 = _$createElement("text");
|
|
1440
|
+
_$insertNode(_el$45, _$createTextNode(`[s] Open affected session`));
|
|
1274
1441
|
_$effect((_p$) => {
|
|
1275
|
-
var _v$
|
|
1276
|
-
_v$
|
|
1277
|
-
_v$
|
|
1442
|
+
var _v$24 = color.text, _v$25 = click(openAffected);
|
|
1443
|
+
_v$24 !== _p$.e && (_p$.e = _$setProp(_el$45, "fg", _v$24, _p$.e));
|
|
1444
|
+
_v$25 !== _p$.t && (_p$.t = _$setProp(_el$45, "onMouseUp", _v$25, _p$.t));
|
|
1278
1445
|
return _p$;
|
|
1279
1446
|
}, {
|
|
1280
1447
|
e: undefined,
|
|
1281
1448
|
t: undefined
|
|
1282
1449
|
});
|
|
1283
|
-
return _el$
|
|
1450
|
+
return _el$45;
|
|
1284
1451
|
})() : _$createElement("box");
|
|
1285
1452
|
})(), null);
|
|
1286
1453
|
_$effect((_p$) => {
|
|
@@ -1306,25 +1473,25 @@ function MemoryDialog(context, sessionID) {
|
|
|
1306
1473
|
_$insert(_el$28, (() => {
|
|
1307
1474
|
var _c$8 = _$memo(() => diagnostics().length > 0);
|
|
1308
1475
|
return () => _c$8() ? (() => {
|
|
1309
|
-
var _el$
|
|
1310
|
-
_$setProp(_el$
|
|
1311
|
-
_$setProp(_el$
|
|
1312
|
-
_$insert(_el$
|
|
1476
|
+
var _el$48 = _$createElement("box");
|
|
1477
|
+
_$setProp(_el$48, "flexDirection", "column");
|
|
1478
|
+
_$setProp(_el$48, "flexShrink", 0);
|
|
1479
|
+
_$insert(_el$48, _$createComponent(Section, {
|
|
1313
1480
|
title: "Diagnostic details"
|
|
1314
1481
|
}), null);
|
|
1315
|
-
_$insert(_el$
|
|
1482
|
+
_$insert(_el$48, _$createComponent(For, {
|
|
1316
1483
|
get each() {
|
|
1317
1484
|
return diagnostics();
|
|
1318
1485
|
},
|
|
1319
1486
|
children: (w) => (() => {
|
|
1320
|
-
var _el$
|
|
1321
|
-
_$setProp(_el$
|
|
1322
|
-
_$insert(_el$
|
|
1323
|
-
_$effect((_$p) => _$setProp(_el$
|
|
1324
|
-
return _el$
|
|
1487
|
+
var _el$49 = _$createElement("text");
|
|
1488
|
+
_$setProp(_el$49, "wrapMode", "word");
|
|
1489
|
+
_$insert(_el$49, `! ${w}`);
|
|
1490
|
+
_$effect((_$p) => _$setProp(_el$49, "fg", color.warn, _$p));
|
|
1491
|
+
return _el$49;
|
|
1325
1492
|
})()
|
|
1326
1493
|
}), null);
|
|
1327
|
-
return _el$
|
|
1494
|
+
return _el$48;
|
|
1328
1495
|
})() : _$createElement("box");
|
|
1329
1496
|
})(), null);
|
|
1330
1497
|
_$insert(_el$28, _$createComponent(Section, {
|
|
@@ -1351,10 +1518,10 @@ function MemoryDialog(context, sessionID) {
|
|
|
1351
1518
|
}), null);
|
|
1352
1519
|
return _el$28;
|
|
1353
1520
|
})() : (() => {
|
|
1354
|
-
var _el$
|
|
1355
|
-
_$setProp(_el$
|
|
1356
|
-
_$setProp(_el$
|
|
1357
|
-
_$insert(_el$
|
|
1521
|
+
var _el$51 = _$createElement("box");
|
|
1522
|
+
_$setProp(_el$51, "flexDirection", "column");
|
|
1523
|
+
_$setProp(_el$51, "marginTop", 1);
|
|
1524
|
+
_$insert(_el$51, _$createComponent(For, {
|
|
1358
1525
|
get each() {
|
|
1359
1526
|
return controls();
|
|
1360
1527
|
},
|
|
@@ -1364,49 +1531,49 @@ function MemoryDialog(context, sessionID) {
|
|
|
1364
1531
|
const fg = () => selected() ? color.selectedText : disabled() ? color.muted : color.text;
|
|
1365
1532
|
const state = () => busy() === c.id ? c.id === "now" ? "Starting\u2026" : c.id === "reset" ? "Resetting\u2026" : "Saving\u2026" : c.id === "reset" && armed() ? "Confirm" : c.on === undefined ? c.enabled ? "Run" : "Unavailable" : c.on ? "On" : "Off";
|
|
1366
1533
|
return (() => {
|
|
1367
|
-
var _el$
|
|
1368
|
-
_$insertNode(_el$
|
|
1369
|
-
_$insertNode(_el$
|
|
1370
|
-
_$setProp(_el$
|
|
1371
|
-
_$setProp(_el$48, "flexShrink", 0);
|
|
1372
|
-
_$setProp(_el$48, "paddingLeft", 1);
|
|
1373
|
-
_$setProp(_el$48, "paddingRight", 1);
|
|
1374
|
-
_$insertNode(_el$49, _el$50);
|
|
1375
|
-
_$insertNode(_el$49, _el$51);
|
|
1376
|
-
_$insertNode(_el$49, _el$52);
|
|
1377
|
-
_$setProp(_el$49, "flexDirection", "row");
|
|
1378
|
-
_$setProp(_el$49, "gap", 1);
|
|
1379
|
-
_$setProp(_el$50, "flexShrink", 0);
|
|
1380
|
-
_$insert(_el$50, () => selected() ? "\u203A" : " ");
|
|
1381
|
-
_$setProp(_el$51, "flexGrow", 1);
|
|
1382
|
-
_$setProp(_el$51, "flexShrink", 1);
|
|
1383
|
-
_$setProp(_el$51, "wrapMode", "word");
|
|
1384
|
-
_$insert(_el$51, (() => {
|
|
1385
|
-
var _c$10 = _$memo(() => !!selected());
|
|
1386
|
-
return () => _c$10() ? (() => {
|
|
1387
|
-
var _el$55 = _$createElement("b");
|
|
1388
|
-
_$insert(_el$55, () => c.title);
|
|
1389
|
-
return _el$55;
|
|
1390
|
-
})() : c.title;
|
|
1391
|
-
})());
|
|
1534
|
+
var _el$52 = _$createElement("box"), _el$53 = _$createElement("box"), _el$54 = _$createElement("text"), _el$55 = _$createElement("text"), _el$56 = _$createElement("text"), _el$57 = _$createElement("box"), _el$58 = _$createElement("text");
|
|
1535
|
+
_$insertNode(_el$52, _el$53);
|
|
1536
|
+
_$insertNode(_el$52, _el$57);
|
|
1537
|
+
_$setProp(_el$52, "flexDirection", "column");
|
|
1392
1538
|
_$setProp(_el$52, "flexShrink", 0);
|
|
1393
|
-
_$
|
|
1539
|
+
_$setProp(_el$52, "paddingLeft", 1);
|
|
1540
|
+
_$setProp(_el$52, "paddingRight", 1);
|
|
1394
1541
|
_$insertNode(_el$53, _el$54);
|
|
1395
|
-
_$
|
|
1396
|
-
_$
|
|
1397
|
-
_$
|
|
1542
|
+
_$insertNode(_el$53, _el$55);
|
|
1543
|
+
_$insertNode(_el$53, _el$56);
|
|
1544
|
+
_$setProp(_el$53, "flexDirection", "row");
|
|
1545
|
+
_$setProp(_el$53, "gap", 1);
|
|
1546
|
+
_$setProp(_el$54, "flexShrink", 0);
|
|
1547
|
+
_$insert(_el$54, () => selected() ? "\u203A" : " ");
|
|
1548
|
+
_$setProp(_el$55, "flexGrow", 1);
|
|
1549
|
+
_$setProp(_el$55, "flexShrink", 1);
|
|
1550
|
+
_$setProp(_el$55, "wrapMode", "word");
|
|
1551
|
+
_$insert(_el$55, (() => {
|
|
1552
|
+
var _c$12 = _$memo(() => !!selected());
|
|
1553
|
+
return () => _c$12() ? (() => {
|
|
1554
|
+
var _el$59 = _$createElement("b");
|
|
1555
|
+
_$insert(_el$59, () => c.title);
|
|
1556
|
+
return _el$59;
|
|
1557
|
+
})() : c.title;
|
|
1558
|
+
})());
|
|
1559
|
+
_$setProp(_el$56, "flexShrink", 0);
|
|
1560
|
+
_$insert(_el$56, state);
|
|
1561
|
+
_$insertNode(_el$57, _el$58);
|
|
1562
|
+
_$setProp(_el$57, "paddingLeft", 2);
|
|
1563
|
+
_$setProp(_el$58, "wrapMode", "word");
|
|
1564
|
+
_$insert(_el$58, () => c.hint);
|
|
1398
1565
|
_$effect((_p$) => {
|
|
1399
|
-
var _v$
|
|
1566
|
+
var _v$26 = `memory-control-${c.id}`, _v$27 = selected() ? color.selectedBg : undefined, _v$28 = click(() => {
|
|
1400
1567
|
select(i());
|
|
1401
1568
|
activate(i());
|
|
1402
|
-
}), _v$
|
|
1403
|
-
_v$
|
|
1404
|
-
_v$
|
|
1405
|
-
_v$
|
|
1406
|
-
_v$
|
|
1407
|
-
_v$
|
|
1408
|
-
_v$
|
|
1409
|
-
_v$
|
|
1569
|
+
}), _v$29 = fg(), _v$30 = fg(), _v$31 = selected() ? color.selectedText : c.on && !disabled() ? color.ok : color.muted, _v$32 = selected() ? color.selectedText : color.muted;
|
|
1570
|
+
_v$26 !== _p$.e && (_p$.e = _$setProp(_el$52, "id", _v$26, _p$.e));
|
|
1571
|
+
_v$27 !== _p$.t && (_p$.t = _$setProp(_el$52, "backgroundColor", _v$27, _p$.t));
|
|
1572
|
+
_v$28 !== _p$.a && (_p$.a = _$setProp(_el$52, "onMouseUp", _v$28, _p$.a));
|
|
1573
|
+
_v$29 !== _p$.o && (_p$.o = _$setProp(_el$54, "fg", _v$29, _p$.o));
|
|
1574
|
+
_v$30 !== _p$.i && (_p$.i = _$setProp(_el$55, "fg", _v$30, _p$.i));
|
|
1575
|
+
_v$31 !== _p$.n && (_p$.n = _$setProp(_el$56, "fg", _v$31, _p$.n));
|
|
1576
|
+
_v$32 !== _p$.s && (_p$.s = _$setProp(_el$58, "fg", _v$32, _p$.s));
|
|
1410
1577
|
return _p$;
|
|
1411
1578
|
}, {
|
|
1412
1579
|
e: undefined,
|
|
@@ -1417,39 +1584,39 @@ function MemoryDialog(context, sessionID) {
|
|
|
1417
1584
|
n: undefined,
|
|
1418
1585
|
s: undefined
|
|
1419
1586
|
});
|
|
1420
|
-
return _el$
|
|
1587
|
+
return _el$52;
|
|
1421
1588
|
})();
|
|
1422
1589
|
}
|
|
1423
1590
|
}), null);
|
|
1424
|
-
_$insert(_el$
|
|
1591
|
+
_$insert(_el$51, _$createComponent(Note, {
|
|
1425
1592
|
get fg() {
|
|
1426
1593
|
return color.muted;
|
|
1427
1594
|
},
|
|
1428
1595
|
children: "The first two toggles affect all projects until the server restarts. Set plugin options in opencode.json(c) to keep them."
|
|
1429
1596
|
}), null);
|
|
1430
|
-
return _el$
|
|
1597
|
+
return _el$51;
|
|
1431
1598
|
})();
|
|
1432
1599
|
})());
|
|
1433
1600
|
_$insert(_el$9, (() => {
|
|
1434
1601
|
var _c$3 = _$memo(() => !!(!unavailable() && (busy() || notice())));
|
|
1435
1602
|
return () => _c$3() ? (() => {
|
|
1436
|
-
var _el$
|
|
1437
|
-
_$insertNode(_el$
|
|
1438
|
-
_$setProp(_el$
|
|
1439
|
-
_$setProp(_el$
|
|
1440
|
-
_$setProp(_el$
|
|
1441
|
-
_$insert(_el$
|
|
1442
|
-
var _c$
|
|
1443
|
-
return () => _c$
|
|
1603
|
+
var _el$60 = _$createElement("box"), _el$61 = _$createElement("text");
|
|
1604
|
+
_$insertNode(_el$60, _el$61);
|
|
1605
|
+
_$setProp(_el$60, "marginTop", 1);
|
|
1606
|
+
_$setProp(_el$60, "flexShrink", 0);
|
|
1607
|
+
_$setProp(_el$61, "wrapMode", "word");
|
|
1608
|
+
_$insert(_el$61, (() => {
|
|
1609
|
+
var _c$13 = _$memo(() => !!busy());
|
|
1610
|
+
return () => _c$13() ? busy() === "retry" ? "Starting retry\u2026" : "Applying change\u2026" : _$memo(() => notice()?.tone === "error")() ? tab() === "Overview" ? "Change failed. Details above." : "Change failed. See Overview for details." : notice().message;
|
|
1444
1611
|
})());
|
|
1445
|
-
_$effect((_$p) => _$setProp(_el$
|
|
1446
|
-
return _el$
|
|
1447
|
-
})() : _$memo(() => !!(tab() === "Controls" && retry()))() ? _$createComponent(Note, {
|
|
1612
|
+
_$effect((_$p) => _$setProp(_el$61, "fg", busy() ? color.muted : notice()?.tone === "error" ? color.error : notice()?.tone === "warn" ? color.warn : color.ok, _$p));
|
|
1613
|
+
return _el$60;
|
|
1614
|
+
})() : _$memo(() => !!(tab() === "Controls" && retry() && retry().action !== "update"))() ? _$createComponent(Note, {
|
|
1448
1615
|
get fg() {
|
|
1449
1616
|
return color.muted;
|
|
1450
1617
|
},
|
|
1451
1618
|
get children() {
|
|
1452
|
-
return _$memo(() => retry().state === "running")() ? `Retrying ${retry().phase}\u2026` : `${
|
|
1619
|
+
return _$memo(() => retry().state === "running")() ? _$memo(() => retry().action === "update")() ? "Updating memory\u2026" : `Retrying ${retry().phase}\u2026` : `${retryResultLabel(retry())}: ${retry().state}. See Overview.`;
|
|
1453
1620
|
}
|
|
1454
1621
|
}) : _$createElement("box");
|
|
1455
1622
|
})(), _el$18);
|
|
@@ -1461,11 +1628,11 @@ function MemoryDialog(context, sessionID) {
|
|
|
1461
1628
|
_$insert(_el$18, (() => {
|
|
1462
1629
|
var _c$4 = _$memo(() => !!(tab() === "Overview" && retryShortcuts()));
|
|
1463
1630
|
return () => _c$4() ? (() => {
|
|
1464
|
-
var _el$
|
|
1465
|
-
_$setProp(_el$
|
|
1466
|
-
_$insert(_el$
|
|
1467
|
-
_$effect((_$p) => _$setProp(_el$
|
|
1468
|
-
return _el$
|
|
1631
|
+
var _el$63 = _$createElement("text");
|
|
1632
|
+
_$setProp(_el$63, "wrapMode", "word");
|
|
1633
|
+
_$insert(_el$63, retryShortcuts);
|
|
1634
|
+
_$effect((_$p) => _$setProp(_el$63, "fg", color.text, _$p));
|
|
1635
|
+
return _el$63;
|
|
1469
1636
|
})() : _$createElement("box");
|
|
1470
1637
|
})(), _el$19);
|
|
1471
1638
|
_$insertNode(_el$19, _el$20);
|
|
@@ -1501,7 +1668,8 @@ function StatusPanel(context, sessionID) {
|
|
|
1501
1668
|
const rpc = context.client.rpc(MemoryStatusRpc);
|
|
1502
1669
|
const {
|
|
1503
1670
|
status,
|
|
1504
|
-
unavailable
|
|
1671
|
+
unavailable,
|
|
1672
|
+
updatedAt
|
|
1505
1673
|
} = watchStatus(rpc, context, sessionID);
|
|
1506
1674
|
const palette = colors(context);
|
|
1507
1675
|
const title = () => {
|
|
@@ -1510,7 +1678,8 @@ function StatusPanel(context, sessionID) {
|
|
|
1510
1678
|
const s = status();
|
|
1511
1679
|
if (!s)
|
|
1512
1680
|
return "Loading\u2026";
|
|
1513
|
-
|
|
1681
|
+
const learning = s.generateMemories ? "on" : isMemoryRunning(s, updatedAt()) ? "pausing" : "off";
|
|
1682
|
+
return `Recall ${s.useMemories ? "on" : "off"} \xB7 learn ${learning}`;
|
|
1514
1683
|
};
|
|
1515
1684
|
const color = () => {
|
|
1516
1685
|
if (unavailable())
|
|
@@ -1520,27 +1689,27 @@ function StatusPanel(context, sessionID) {
|
|
|
1520
1689
|
return palette.muted;
|
|
1521
1690
|
};
|
|
1522
1691
|
return (() => {
|
|
1523
|
-
var _el$
|
|
1524
|
-
_$insertNode(_el$
|
|
1525
|
-
_$insertNode(_el$
|
|
1526
|
-
_$insertNode(_el$
|
|
1527
|
-
_$setProp(_el$
|
|
1528
|
-
_$insertNode(_el$
|
|
1529
|
-
_$insertNode(_el$
|
|
1530
|
-
_$insert(_el$
|
|
1531
|
-
_$insertNode(_el$
|
|
1692
|
+
var _el$65 = _$createElement("box"), _el$66 = _$createElement("text"), _el$68 = _$createElement("text"), _el$69 = _$createTextNode(`\u25CF `), _el$70 = _$createElement("text");
|
|
1693
|
+
_$insertNode(_el$65, _el$66);
|
|
1694
|
+
_$insertNode(_el$65, _el$68);
|
|
1695
|
+
_$insertNode(_el$65, _el$70);
|
|
1696
|
+
_$setProp(_el$65, "flexDirection", "column");
|
|
1697
|
+
_$insertNode(_el$66, _$createTextNode(`Memory`));
|
|
1698
|
+
_$insertNode(_el$68, _el$69);
|
|
1699
|
+
_$insert(_el$68, title, null);
|
|
1700
|
+
_$insertNode(_el$70, _$createTextNode(` /memory-inspect`));
|
|
1532
1701
|
_$effect((_p$) => {
|
|
1533
|
-
var _v$
|
|
1534
|
-
_v$
|
|
1535
|
-
_v$
|
|
1536
|
-
_v$
|
|
1702
|
+
var _v$33 = palette.text, _v$34 = color(), _v$35 = palette.muted;
|
|
1703
|
+
_v$33 !== _p$.e && (_p$.e = _$setProp(_el$66, "fg", _v$33, _p$.e));
|
|
1704
|
+
_v$34 !== _p$.t && (_p$.t = _$setProp(_el$68, "fg", _v$34, _p$.t));
|
|
1705
|
+
_v$35 !== _p$.a && (_p$.a = _$setProp(_el$70, "fg", _v$35, _p$.a));
|
|
1537
1706
|
return _p$;
|
|
1538
1707
|
}, {
|
|
1539
1708
|
e: undefined,
|
|
1540
1709
|
t: undefined,
|
|
1541
1710
|
a: undefined
|
|
1542
1711
|
});
|
|
1543
|
-
return _el$
|
|
1712
|
+
return _el$65;
|
|
1544
1713
|
})();
|
|
1545
1714
|
}
|
|
1546
1715
|
function KeymapLayer(context) {
|