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/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);
|
|
@@ -370,12 +424,14 @@ function hasConsolidationLease(pipeline, now) {
|
|
|
370
424
|
return pipeline.phase2Status === "running" && (pipeline.phase2LeaseUntil == null || pipeline.phase2LeaseUntil > now);
|
|
371
425
|
}
|
|
372
426
|
function activeMemoryWork(status, now) {
|
|
373
|
-
if (status.manualRetry?.state === "running")
|
|
427
|
+
if (status.manualRetry?.state === "running" && status.manualRetry.action !== "update")
|
|
374
428
|
return "retry";
|
|
375
429
|
if (status.activity === "consolidating")
|
|
376
430
|
return "consolidation";
|
|
377
431
|
if (status.activity === "extracting")
|
|
378
432
|
return "extraction";
|
|
433
|
+
if (status.manualRetry?.state === "running")
|
|
434
|
+
return "consolidation";
|
|
379
435
|
if (status.pipelines.some((pipeline) => hasConsolidationLease(pipeline, now)))
|
|
380
436
|
return "consolidation";
|
|
381
437
|
if (status.pipelines.some((pipeline) => pipeline.extracting > 0))
|
|
@@ -495,7 +551,6 @@ function configRows(s) {
|
|
|
495
551
|
{ label: "Location", value: s.memoryRoot }
|
|
496
552
|
];
|
|
497
553
|
}
|
|
498
|
-
|
|
499
554
|
// src/v2/panel-messages.ts
|
|
500
555
|
var memoryHelp = {
|
|
501
556
|
models: { label: "Background model setup", path: "configuration.md#choose-background-models" },
|
|
@@ -514,6 +569,26 @@ var retryLabels = {
|
|
|
514
569
|
extraction: { action: "Retry extraction", result: "Extraction retry" },
|
|
515
570
|
consolidation: { action: "Retry consolidation", result: "Consolidation retry" }
|
|
516
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
|
+
}
|
|
517
592
|
var retryWaitMessages = {
|
|
518
593
|
retry: "A memory retry is already running. Wait for it to finish.",
|
|
519
594
|
consolidation: "A background memory update is running. You can retry when it finishes.",
|
|
@@ -522,15 +597,26 @@ var retryWaitMessages = {
|
|
|
522
597
|
function retryDescription(times, now) {
|
|
523
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.";
|
|
524
599
|
}
|
|
525
|
-
function noticeMessage(kind, details, now, offersRetry, retryBlockedReason,
|
|
600
|
+
function noticeMessage(kind, details, now, offersRetry, retryBlockedReason, status, sessionID) {
|
|
526
601
|
const canRetry = offersRetry && !retryBlockedReason;
|
|
527
602
|
switch (kind) {
|
|
528
603
|
case "extraction_exhausted": {
|
|
529
604
|
const current = sessionID ? details.find((notice) => notice.sessionID === sessionID) : undefined;
|
|
530
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
|
+
}
|
|
531
617
|
const recovery = modelRecoveryGuidance(details.filter((notice) => notice.sessionID === affected?.sessionID).map((notice) => notice.detail ?? ""), "extraction");
|
|
532
618
|
const conversation = current ? "this conversation" : "an affected conversation";
|
|
533
|
-
const nextStep = canRetry ? "Retry a batch with the current background models. No new message is needed." : offersRetry ? undefined :
|
|
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.`;
|
|
534
620
|
return {
|
|
535
621
|
title: "Learning stopped for some sessions",
|
|
536
622
|
description: [recovery?.description ?? "Some conversations ran out of retries.", nextStep].filter(Boolean).join(" "),
|
|
@@ -605,6 +691,13 @@ function memoryMessages(status, now, sessionID) {
|
|
|
605
691
|
if (status.activity === "stopping")
|
|
606
692
|
return [{ title: "Memory is stopping", description: "Wait for OpenCode to reconnect." }];
|
|
607
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
|
+
];
|
|
608
701
|
const retryBlockedReason = !status.generateMemories ? "Turn on Learn from sessions to retry." : work ? retryWaitMessages[work] : undefined;
|
|
609
702
|
const shownRetries = new Set;
|
|
610
703
|
const messages = MEMORY_NOTICE_KINDS.flatMap((kind) => {
|
|
@@ -621,16 +714,26 @@ function memoryMessages(status, now, sessionID) {
|
|
|
621
714
|
}
|
|
622
715
|
}
|
|
623
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);
|
|
624
720
|
return [
|
|
625
721
|
{
|
|
626
|
-
...
|
|
722
|
+
...message,
|
|
723
|
+
description: queue?.ready ? `${message.description} ${extractionQueueText(queue)}` : message.description,
|
|
627
724
|
retryPhases,
|
|
628
|
-
retryBlockedReason: offersRetry ?
|
|
725
|
+
retryBlockedReason: offersRetry ? blocked : undefined
|
|
629
726
|
}
|
|
630
727
|
];
|
|
631
728
|
});
|
|
632
729
|
if (status.manualRetry?.state === "running")
|
|
633
|
-
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
|
+
];
|
|
634
737
|
if (status.generateMemories) {
|
|
635
738
|
const active = status.pipelines.filter((pipeline) => status.dualWrite || pipeline.version === status.version);
|
|
636
739
|
if (status.activity === "consolidating") {
|
|
@@ -783,21 +886,26 @@ function MemoryDialog(context, sessionID) {
|
|
|
783
886
|
const snapshot = status();
|
|
784
887
|
return busy() !== null || !snapshot?.generateMemories || snapshot.activity === "stopping" || isMemoryRunning(snapshot, updatedAt());
|
|
785
888
|
};
|
|
786
|
-
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());
|
|
787
891
|
const needsProvider = () => messages().some((message) => message.help === "providers");
|
|
788
892
|
const affectedSession = () => messages().find((message) => message.affectedSessionID)?.affectedSessionID;
|
|
789
893
|
const diagnostics = createMemo(() => {
|
|
790
894
|
const snapshot = status();
|
|
791
|
-
return snapshot?.notices === undefined || unavailable() ? snapshot?.warnings ?? [] : messages().flatMap((message) => (message.details ?? []).
|
|
792
|
-
detail,
|
|
793
|
-
version
|
|
794
|
-
}) => detail ? [`${version ? `${version.toUpperCase()}: ` : ""}${detail}`] : []));
|
|
895
|
+
return snapshot?.notices === undefined || unavailable() ? snapshot?.warnings ?? [] : messages().flatMap((message) => (message.details ?? []).filter((entry) => entry.detail).map(noticeDetail));
|
|
795
896
|
});
|
|
796
897
|
const call = async (id, method, input, done) => {
|
|
797
898
|
if (busy() || unavailable() || status()?.activity === "stopping")
|
|
798
899
|
return;
|
|
799
900
|
setBusy(id);
|
|
800
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
|
+
};
|
|
801
909
|
try {
|
|
802
910
|
const result = await rpc[method](input, {
|
|
803
911
|
location: context.location ?? context.data.location.default(),
|
|
@@ -807,33 +915,32 @@ function MemoryDialog(context, sessionID) {
|
|
|
807
915
|
return;
|
|
808
916
|
const reply = result;
|
|
809
917
|
if (method === "consolidateNow" ? reply?.status !== "started" : reply?.ok !== true) {
|
|
810
|
-
|
|
811
|
-
}
|
|
812
|
-
if (done)
|
|
918
|
+
reportFailure(reply?.message ?? "The server did not apply the request. Refresh and try again.");
|
|
919
|
+
} else if (done) {
|
|
813
920
|
setNotice({
|
|
814
921
|
message: done,
|
|
815
922
|
tone: "ok"
|
|
816
923
|
});
|
|
924
|
+
}
|
|
817
925
|
await refresh();
|
|
818
926
|
} catch (error) {
|
|
819
927
|
if (signal.aborted)
|
|
820
928
|
return;
|
|
821
|
-
|
|
822
|
-
setNotice({
|
|
823
|
-
message: `${label}: ${error instanceof Error ? error.message : String(error)}`,
|
|
824
|
-
tone: "error"
|
|
825
|
-
});
|
|
929
|
+
reportFailure(error instanceof Error ? error.message : String(error));
|
|
826
930
|
await refresh();
|
|
827
931
|
} finally {
|
|
828
932
|
if (!signal.aborted)
|
|
829
933
|
setBusy(null);
|
|
830
934
|
}
|
|
831
935
|
};
|
|
832
|
-
const startRetry = (phase) => {
|
|
833
|
-
if (!canRetry(phase))
|
|
936
|
+
const startRetry = (phase, all = false) => {
|
|
937
|
+
if (all ? !canRetryAll() : !canRetry(phase))
|
|
834
938
|
return;
|
|
835
939
|
scroll?.scrollTo(0);
|
|
836
|
-
call("retry", "retryFailed", {
|
|
940
|
+
call("retry", "retryFailed", all ? {
|
|
941
|
+
phase,
|
|
942
|
+
all
|
|
943
|
+
} : {
|
|
837
944
|
phase
|
|
838
945
|
});
|
|
839
946
|
};
|
|
@@ -874,7 +981,7 @@ function MemoryDialog(context, sessionID) {
|
|
|
874
981
|
run: () => void call("learn", "setOption", {
|
|
875
982
|
key: "generate_memories",
|
|
876
983
|
value: !s.generateMemories
|
|
877
|
-
}, s.generateMemories ? "Learning paused." : "Learning resumed.")
|
|
984
|
+
}, s.generateMemories ? isMemoryRunning(s, updatedAt()) ? "Pausing after current memory work." : "Learning paused." : "Learning resumed.")
|
|
878
985
|
}];
|
|
879
986
|
if (sessionID) {
|
|
880
987
|
const learning = s.sessionMode !== "disabled" && s.sessionMode !== "polluted";
|
|
@@ -891,12 +998,13 @@ function MemoryDialog(context, sessionID) {
|
|
|
891
998
|
});
|
|
892
999
|
}
|
|
893
1000
|
const running = isMemoryRunning(s, updatedAt());
|
|
1001
|
+
const update = s.manualRetry?.action === "update" ? s.manualRetry : undefined;
|
|
894
1002
|
list.push({
|
|
895
1003
|
id: "now",
|
|
896
1004
|
title: "Consolidate now",
|
|
897
|
-
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.",
|
|
898
1006
|
enabled: s.generateMemories && !running && s.activity !== "stopping",
|
|
899
|
-
run: () => void call("now", "consolidateNow", {}
|
|
1007
|
+
run: () => void call("now", "consolidateNow", {})
|
|
900
1008
|
});
|
|
901
1009
|
list.push({
|
|
902
1010
|
id: "reset",
|
|
@@ -982,7 +1090,7 @@ function MemoryDialog(context, sessionID) {
|
|
|
982
1090
|
event.stopPropagation();
|
|
983
1091
|
action();
|
|
984
1092
|
};
|
|
985
|
-
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 ");
|
|
986
1094
|
context.keymap.layer(() => ({
|
|
987
1095
|
mode: "modal",
|
|
988
1096
|
commands: [...["left", "shift+tab"].map((bind) => ({
|
|
@@ -1028,11 +1136,16 @@ function MemoryDialog(context, sessionID) {
|
|
|
1028
1136
|
refresh();
|
|
1029
1137
|
}
|
|
1030
1138
|
}, ...RETRY_PHASES.map((phase) => ({
|
|
1031
|
-
title:
|
|
1139
|
+
title: retryActionLabel(phase, status()),
|
|
1032
1140
|
bind: RETRY_KEYS[phase],
|
|
1033
1141
|
enabled: () => tab() === "Overview" && canRetry(phase),
|
|
1034
1142
|
run: () => startRetry(phase)
|
|
1035
1143
|
})), {
|
|
1144
|
+
title: "Retry all eligible conversations",
|
|
1145
|
+
bind: "a",
|
|
1146
|
+
enabled: () => tab() === "Overview" && canRetryAll(),
|
|
1147
|
+
run: () => startRetry("extraction", true)
|
|
1148
|
+
}, {
|
|
1036
1149
|
title: memoryHelp.providers.label,
|
|
1037
1150
|
bind: "p",
|
|
1038
1151
|
enabled: () => tab() === "Overview" && needsProvider(),
|
|
@@ -1213,7 +1326,7 @@ function MemoryDialog(context, sessionID) {
|
|
|
1213
1326
|
return _$memo(() => retryResult().state === "completed")() ? color.ok : color.warn;
|
|
1214
1327
|
},
|
|
1215
1328
|
get children() {
|
|
1216
|
-
return `${
|
|
1329
|
+
return `${retryResultLabel(retryResult())}: ${retryResultText(retryResult())}`;
|
|
1217
1330
|
}
|
|
1218
1331
|
}) : _$createElement("box");
|
|
1219
1332
|
})(), null);
|
|
@@ -1241,10 +1354,10 @@ function MemoryDialog(context, sessionID) {
|
|
|
1241
1354
|
var _el$35 = _$createElement("text");
|
|
1242
1355
|
_$setProp(_el$35, "wrapMode", "word");
|
|
1243
1356
|
_$insert(_el$35, (() => {
|
|
1244
|
-
var _c$
|
|
1245
|
-
return () => _c$
|
|
1357
|
+
var _c$11 = _$memo(() => !!canRetry(phase));
|
|
1358
|
+
return () => _c$11() ? `[${RETRY_KEYS[phase]}] ` : "";
|
|
1246
1359
|
})(), null);
|
|
1247
|
-
_$insert(_el$35, () =>
|
|
1360
|
+
_$insert(_el$35, () => retryActionLabel(phase, status()), null);
|
|
1248
1361
|
_$insert(_el$35, () => canRetry(phase) ? "" : " (unavailable)", null);
|
|
1249
1362
|
_$effect((_p$) => {
|
|
1250
1363
|
var _v$16 = canRetry(phase) ? color.text : color.muted, _v$17 = click(() => startRetry(phase));
|
|
@@ -1259,63 +1372,82 @@ function MemoryDialog(context, sessionID) {
|
|
|
1259
1372
|
})()
|
|
1260
1373
|
}), null);
|
|
1261
1374
|
_$insert(_el$31, (() => {
|
|
1262
|
-
var _c$9 = _$memo(() => !!message().
|
|
1375
|
+
var _c$9 = _$memo(() => !!(message().retryPhases?.includes("extraction") && retryAllLabel(status())));
|
|
1263
1376
|
return () => _c$9() ? (() => {
|
|
1264
1377
|
var _el$36 = _$createElement("text");
|
|
1265
1378
|
_$setProp(_el$36, "wrapMode", "word");
|
|
1266
|
-
_$insert(_el$36, () =>
|
|
1267
|
-
_$
|
|
1379
|
+
_$insert(_el$36, () => canRetryAll() ? "[a] " : "", null);
|
|
1380
|
+
_$insert(_el$36, () => retryAllLabel(status()), null);
|
|
1381
|
+
_$effect((_p$) => {
|
|
1382
|
+
var _v$18 = canRetryAll() ? color.text : color.muted, _v$19 = click(() => startRetry("extraction", true));
|
|
1383
|
+
_v$18 !== _p$.e && (_p$.e = _$setProp(_el$36, "fg", _v$18, _p$.e));
|
|
1384
|
+
_v$19 !== _p$.t && (_p$.t = _$setProp(_el$36, "onMouseUp", _v$19, _p$.t));
|
|
1385
|
+
return _p$;
|
|
1386
|
+
}, {
|
|
1387
|
+
e: undefined,
|
|
1388
|
+
t: undefined
|
|
1389
|
+
});
|
|
1268
1390
|
return _el$36;
|
|
1269
1391
|
})() : _$createElement("box");
|
|
1270
1392
|
})(), null);
|
|
1271
1393
|
_$insert(_el$31, (() => {
|
|
1272
|
-
var _c$0 = _$memo(() => message().
|
|
1394
|
+
var _c$0 = _$memo(() => !!message().retryBlockedReason);
|
|
1273
1395
|
return () => _c$0() ? (() => {
|
|
1274
|
-
var _el$38 = _$createElement("text")
|
|
1275
|
-
_$
|
|
1276
|
-
_$insert(_el$38, () =>
|
|
1396
|
+
var _el$38 = _$createElement("text");
|
|
1397
|
+
_$setProp(_el$38, "wrapMode", "word");
|
|
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);
|
|
1277
1409
|
_$effect((_p$) => {
|
|
1278
|
-
var _v$
|
|
1279
|
-
_v$
|
|
1280
|
-
_v$
|
|
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));
|
|
1281
1413
|
return _p$;
|
|
1282
1414
|
}, {
|
|
1283
1415
|
e: undefined,
|
|
1284
1416
|
t: undefined
|
|
1285
1417
|
});
|
|
1286
|
-
return _el$
|
|
1418
|
+
return _el$40;
|
|
1287
1419
|
})() : _$memo(() => !!message().help)() ? (() => {
|
|
1288
|
-
var _el$
|
|
1289
|
-
_$insertNode(_el$
|
|
1290
|
-
_$setProp(_el$
|
|
1291
|
-
_$insert(_el$
|
|
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);
|
|
1292
1424
|
_$effect((_p$) => {
|
|
1293
|
-
var _v$
|
|
1294
|
-
_v$
|
|
1295
|
-
_v$
|
|
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));
|
|
1296
1428
|
return _p$;
|
|
1297
1429
|
}, {
|
|
1298
1430
|
e: undefined,
|
|
1299
1431
|
t: undefined
|
|
1300
1432
|
});
|
|
1301
|
-
return _el$
|
|
1433
|
+
return _el$42;
|
|
1302
1434
|
})() : _$createElement("box");
|
|
1303
1435
|
})(), null);
|
|
1304
1436
|
_$insert(_el$31, (() => {
|
|
1305
|
-
var _c$
|
|
1306
|
-
return () => _c$
|
|
1307
|
-
var _el$
|
|
1308
|
-
_$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`));
|
|
1309
1441
|
_$effect((_p$) => {
|
|
1310
|
-
var _v$
|
|
1311
|
-
_v$
|
|
1312
|
-
_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));
|
|
1313
1445
|
return _p$;
|
|
1314
1446
|
}, {
|
|
1315
1447
|
e: undefined,
|
|
1316
1448
|
t: undefined
|
|
1317
1449
|
});
|
|
1318
|
-
return _el$
|
|
1450
|
+
return _el$45;
|
|
1319
1451
|
})() : _$createElement("box");
|
|
1320
1452
|
})(), null);
|
|
1321
1453
|
_$effect((_p$) => {
|
|
@@ -1341,25 +1473,25 @@ function MemoryDialog(context, sessionID) {
|
|
|
1341
1473
|
_$insert(_el$28, (() => {
|
|
1342
1474
|
var _c$8 = _$memo(() => diagnostics().length > 0);
|
|
1343
1475
|
return () => _c$8() ? (() => {
|
|
1344
|
-
var _el$
|
|
1345
|
-
_$setProp(_el$
|
|
1346
|
-
_$setProp(_el$
|
|
1347
|
-
_$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, {
|
|
1348
1480
|
title: "Diagnostic details"
|
|
1349
1481
|
}), null);
|
|
1350
|
-
_$insert(_el$
|
|
1482
|
+
_$insert(_el$48, _$createComponent(For, {
|
|
1351
1483
|
get each() {
|
|
1352
1484
|
return diagnostics();
|
|
1353
1485
|
},
|
|
1354
1486
|
children: (w) => (() => {
|
|
1355
|
-
var _el$
|
|
1356
|
-
_$setProp(_el$
|
|
1357
|
-
_$insert(_el$
|
|
1358
|
-
_$effect((_$p) => _$setProp(_el$
|
|
1359
|
-
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;
|
|
1360
1492
|
})()
|
|
1361
1493
|
}), null);
|
|
1362
|
-
return _el$
|
|
1494
|
+
return _el$48;
|
|
1363
1495
|
})() : _$createElement("box");
|
|
1364
1496
|
})(), null);
|
|
1365
1497
|
_$insert(_el$28, _$createComponent(Section, {
|
|
@@ -1386,10 +1518,10 @@ function MemoryDialog(context, sessionID) {
|
|
|
1386
1518
|
}), null);
|
|
1387
1519
|
return _el$28;
|
|
1388
1520
|
})() : (() => {
|
|
1389
|
-
var _el$
|
|
1390
|
-
_$setProp(_el$
|
|
1391
|
-
_$setProp(_el$
|
|
1392
|
-
_$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, {
|
|
1393
1525
|
get each() {
|
|
1394
1526
|
return controls();
|
|
1395
1527
|
},
|
|
@@ -1399,49 +1531,49 @@ function MemoryDialog(context, sessionID) {
|
|
|
1399
1531
|
const fg = () => selected() ? color.selectedText : disabled() ? color.muted : color.text;
|
|
1400
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";
|
|
1401
1533
|
return (() => {
|
|
1402
|
-
var _el$
|
|
1403
|
-
_$insertNode(_el$
|
|
1404
|
-
_$insertNode(_el$
|
|
1405
|
-
_$setProp(_el$
|
|
1406
|
-
_$setProp(_el$50, "flexShrink", 0);
|
|
1407
|
-
_$setProp(_el$50, "paddingLeft", 1);
|
|
1408
|
-
_$setProp(_el$50, "paddingRight", 1);
|
|
1409
|
-
_$insertNode(_el$51, _el$52);
|
|
1410
|
-
_$insertNode(_el$51, _el$53);
|
|
1411
|
-
_$insertNode(_el$51, _el$54);
|
|
1412
|
-
_$setProp(_el$51, "flexDirection", "row");
|
|
1413
|
-
_$setProp(_el$51, "gap", 1);
|
|
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");
|
|
1414
1538
|
_$setProp(_el$52, "flexShrink", 0);
|
|
1415
|
-
_$
|
|
1416
|
-
_$setProp(_el$
|
|
1417
|
-
_$
|
|
1418
|
-
_$
|
|
1419
|
-
_$
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1539
|
+
_$setProp(_el$52, "paddingLeft", 1);
|
|
1540
|
+
_$setProp(_el$52, "paddingRight", 1);
|
|
1541
|
+
_$insertNode(_el$53, _el$54);
|
|
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;
|
|
1425
1557
|
})() : c.title;
|
|
1426
1558
|
})());
|
|
1427
|
-
_$setProp(_el$
|
|
1428
|
-
_$insert(_el$
|
|
1429
|
-
_$insertNode(_el$
|
|
1430
|
-
_$setProp(_el$
|
|
1431
|
-
_$setProp(_el$
|
|
1432
|
-
_$insert(_el$
|
|
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);
|
|
1433
1565
|
_$effect((_p$) => {
|
|
1434
|
-
var _v$
|
|
1566
|
+
var _v$26 = `memory-control-${c.id}`, _v$27 = selected() ? color.selectedBg : undefined, _v$28 = click(() => {
|
|
1435
1567
|
select(i());
|
|
1436
1568
|
activate(i());
|
|
1437
|
-
}), _v$
|
|
1438
|
-
_v$
|
|
1439
|
-
_v$
|
|
1440
|
-
_v$
|
|
1441
|
-
_v$
|
|
1442
|
-
_v$
|
|
1443
|
-
_v$
|
|
1444
|
-
_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));
|
|
1445
1577
|
return _p$;
|
|
1446
1578
|
}, {
|
|
1447
1579
|
e: undefined,
|
|
@@ -1452,39 +1584,39 @@ function MemoryDialog(context, sessionID) {
|
|
|
1452
1584
|
n: undefined,
|
|
1453
1585
|
s: undefined
|
|
1454
1586
|
});
|
|
1455
|
-
return _el$
|
|
1587
|
+
return _el$52;
|
|
1456
1588
|
})();
|
|
1457
1589
|
}
|
|
1458
1590
|
}), null);
|
|
1459
|
-
_$insert(_el$
|
|
1591
|
+
_$insert(_el$51, _$createComponent(Note, {
|
|
1460
1592
|
get fg() {
|
|
1461
1593
|
return color.muted;
|
|
1462
1594
|
},
|
|
1463
1595
|
children: "The first two toggles affect all projects until the server restarts. Set plugin options in opencode.json(c) to keep them."
|
|
1464
1596
|
}), null);
|
|
1465
|
-
return _el$
|
|
1597
|
+
return _el$51;
|
|
1466
1598
|
})();
|
|
1467
1599
|
})());
|
|
1468
1600
|
_$insert(_el$9, (() => {
|
|
1469
1601
|
var _c$3 = _$memo(() => !!(!unavailable() && (busy() || notice())));
|
|
1470
1602
|
return () => _c$3() ? (() => {
|
|
1471
|
-
var _el$
|
|
1472
|
-
_$insertNode(_el$
|
|
1473
|
-
_$setProp(_el$
|
|
1474
|
-
_$setProp(_el$
|
|
1475
|
-
_$setProp(_el$
|
|
1476
|
-
_$insert(_el$
|
|
1477
|
-
var _c$
|
|
1478
|
-
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;
|
|
1479
1611
|
})());
|
|
1480
|
-
_$effect((_$p) => _$setProp(_el$
|
|
1481
|
-
return _el$
|
|
1482
|
-
})() : _$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, {
|
|
1483
1615
|
get fg() {
|
|
1484
1616
|
return color.muted;
|
|
1485
1617
|
},
|
|
1486
1618
|
get children() {
|
|
1487
|
-
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.`;
|
|
1488
1620
|
}
|
|
1489
1621
|
}) : _$createElement("box");
|
|
1490
1622
|
})(), _el$18);
|
|
@@ -1496,11 +1628,11 @@ function MemoryDialog(context, sessionID) {
|
|
|
1496
1628
|
_$insert(_el$18, (() => {
|
|
1497
1629
|
var _c$4 = _$memo(() => !!(tab() === "Overview" && retryShortcuts()));
|
|
1498
1630
|
return () => _c$4() ? (() => {
|
|
1499
|
-
var _el$
|
|
1500
|
-
_$setProp(_el$
|
|
1501
|
-
_$insert(_el$
|
|
1502
|
-
_$effect((_$p) => _$setProp(_el$
|
|
1503
|
-
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;
|
|
1504
1636
|
})() : _$createElement("box");
|
|
1505
1637
|
})(), _el$19);
|
|
1506
1638
|
_$insertNode(_el$19, _el$20);
|
|
@@ -1536,7 +1668,8 @@ function StatusPanel(context, sessionID) {
|
|
|
1536
1668
|
const rpc = context.client.rpc(MemoryStatusRpc);
|
|
1537
1669
|
const {
|
|
1538
1670
|
status,
|
|
1539
|
-
unavailable
|
|
1671
|
+
unavailable,
|
|
1672
|
+
updatedAt
|
|
1540
1673
|
} = watchStatus(rpc, context, sessionID);
|
|
1541
1674
|
const palette = colors(context);
|
|
1542
1675
|
const title = () => {
|
|
@@ -1545,7 +1678,8 @@ function StatusPanel(context, sessionID) {
|
|
|
1545
1678
|
const s = status();
|
|
1546
1679
|
if (!s)
|
|
1547
1680
|
return "Loading\u2026";
|
|
1548
|
-
|
|
1681
|
+
const learning = s.generateMemories ? "on" : isMemoryRunning(s, updatedAt()) ? "pausing" : "off";
|
|
1682
|
+
return `Recall ${s.useMemories ? "on" : "off"} \xB7 learn ${learning}`;
|
|
1549
1683
|
};
|
|
1550
1684
|
const color = () => {
|
|
1551
1685
|
if (unavailable())
|
|
@@ -1555,27 +1689,27 @@ function StatusPanel(context, sessionID) {
|
|
|
1555
1689
|
return palette.muted;
|
|
1556
1690
|
};
|
|
1557
1691
|
return (() => {
|
|
1558
|
-
var _el$
|
|
1559
|
-
_$insertNode(_el$
|
|
1560
|
-
_$insertNode(_el$
|
|
1561
|
-
_$insertNode(_el$
|
|
1562
|
-
_$setProp(_el$
|
|
1563
|
-
_$insertNode(_el$
|
|
1564
|
-
_$insertNode(_el$
|
|
1565
|
-
_$insert(_el$
|
|
1566
|
-
_$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`));
|
|
1567
1701
|
_$effect((_p$) => {
|
|
1568
|
-
var _v$
|
|
1569
|
-
_v$
|
|
1570
|
-
_v$
|
|
1571
|
-
_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));
|
|
1572
1706
|
return _p$;
|
|
1573
1707
|
}, {
|
|
1574
1708
|
e: undefined,
|
|
1575
1709
|
t: undefined,
|
|
1576
1710
|
a: undefined
|
|
1577
1711
|
});
|
|
1578
|
-
return _el$
|
|
1712
|
+
return _el$65;
|
|
1579
1713
|
})();
|
|
1580
1714
|
}
|
|
1581
1715
|
function KeymapLayer(context) {
|