@cortexkit/opencode-magic-context 0.33.0 → 0.34.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/dist/config/agent-disable.d.ts +22 -0
- package/dist/config/agent-disable.d.ts.map +1 -1
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/project-security.d.ts +7 -0
- package/dist/config/project-security.d.ts.map +1 -1
- package/dist/config/schema/magic-context.d.ts +144 -24
- package/dist/config/schema/magic-context.d.ts.map +1 -1
- package/dist/config/transform-mode.d.ts +2 -0
- package/dist/config/transform-mode.d.ts.map +1 -1
- package/dist/{conflict-warning-hook-bwa99a04.js → conflict-warning-hook-fvpfvt0w.js} +1 -1
- package/dist/{derive-budgets-e9j09sjr.js → derive-budgets-9crp0cvd.js} +1 -1
- package/dist/features/builtin-commands/commands.d.ts +1 -1
- package/dist/features/builtin-commands/commands.d.ts.map +1 -1
- package/dist/features/magic-context/compaction-marker.d.ts +106 -0
- package/dist/features/magic-context/compaction-marker.d.ts.map +1 -1
- package/dist/features/magic-context/compartment-chunk-embedding.d.ts +0 -2
- package/dist/features/magic-context/compartment-chunk-embedding.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/classify.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/evaluate-smart-notes.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/map-memories.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/refresh-primers.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/task-executor.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/task-registry.d.ts +0 -1
- package/dist/features/magic-context/dreamer/task-registry.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/verify.d.ts.map +1 -1
- package/dist/features/magic-context/fail-closed-block.d.ts +10 -0
- package/dist/features/magic-context/fail-closed-block.d.ts.map +1 -1
- package/dist/features/magic-context/git-commits/index.d.ts +2 -2
- package/dist/features/magic-context/git-commits/index.d.ts.map +1 -1
- package/dist/features/magic-context/git-commits/storage-git-commit-embeddings.d.ts +0 -2
- package/dist/features/magic-context/git-commits/storage-git-commit-embeddings.d.ts.map +1 -1
- package/dist/features/magic-context/git-commits/storage-git-commits.d.ts +0 -13
- package/dist/features/magic-context/git-commits/storage-git-commits.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-identity.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-local.d.ts +7 -1
- package/dist/features/magic-context/memory/embedding-local.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding.d.ts +1 -2
- package/dist/features/magic-context/memory/embedding.d.ts.map +1 -1
- package/dist/features/magic-context/memory/memory-migration.d.ts +0 -6
- package/dist/features/magic-context/memory/memory-migration.d.ts.map +1 -1
- package/dist/features/magic-context/memory/project-identity.d.ts +2 -6
- package/dist/features/magic-context/memory/project-identity.d.ts.map +1 -1
- package/dist/features/magic-context/memory/storage-memory-embeddings.d.ts +0 -1
- package/dist/features/magic-context/memory/storage-memory-embeddings.d.ts.map +1 -1
- package/dist/features/magic-context/memory/storage-memory.d.ts +1 -6
- package/dist/features/magic-context/memory/storage-memory.d.ts.map +1 -1
- package/dist/features/magic-context/memory/verification-paths.d.ts +0 -1
- package/dist/features/magic-context/memory/verification-paths.d.ts.map +1 -1
- package/dist/features/magic-context/migrations.d.ts.map +1 -1
- package/dist/features/magic-context/mural/compress-cues.d.ts.map +1 -1
- package/dist/features/magic-context/mural/render-mural.d.ts.map +1 -1
- package/dist/features/magic-context/mural/storage-mural.d.ts +0 -1
- package/dist/features/magic-context/mural/storage-mural.d.ts.map +1 -1
- package/dist/features/magic-context/overflow-detection.d.ts +8 -1
- package/dist/features/magic-context/overflow-detection.d.ts.map +1 -1
- package/dist/features/magic-context/project-embedding-registry.d.ts +16 -2
- package/dist/features/magic-context/project-embedding-registry.d.ts.map +1 -1
- package/dist/features/magic-context/scheduler.d.ts.map +1 -1
- package/dist/features/magic-context/schema-fence-probe.d.ts +28 -0
- package/dist/features/magic-context/schema-fence-probe.d.ts.map +1 -0
- package/dist/features/magic-context/sidekick/agent.d.ts.map +1 -1
- package/dist/features/magic-context/smart-notes/capabilities.d.ts +0 -2
- package/dist/features/magic-context/smart-notes/capabilities.d.ts.map +1 -1
- package/dist/features/magic-context/smart-notes/compiler.d.ts +0 -1
- package/dist/features/magic-context/smart-notes/compiler.d.ts.map +1 -1
- package/dist/features/magic-context/smart-notes/types.d.ts +0 -16
- package/dist/features/magic-context/smart-notes/types.d.ts.map +1 -1
- package/dist/features/magic-context/storage-db.d.ts +35 -1
- package/dist/features/magic-context/storage-db.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta-persisted.d.ts +38 -5
- package/dist/features/magic-context/storage-meta-persisted.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta.d.ts +1 -1
- package/dist/features/magic-context/storage-meta.d.ts.map +1 -1
- package/dist/features/magic-context/storage.d.ts +1 -1
- package/dist/features/magic-context/storage.d.ts.map +1 -1
- package/dist/features/magic-context/user-memory/review-user-memories.d.ts.map +1 -1
- package/dist/features/magic-context/user-memory/storage-user-memory.d.ts +0 -2
- package/dist/features/magic-context/user-memory/storage-user-memory.d.ts.map +1 -1
- package/dist/hooks/auto-update-checker/types.d.ts +0 -3
- package/dist/hooks/auto-update-checker/types.d.ts.map +1 -1
- package/dist/hooks/magic-context/boundary-execution.d.ts +1 -1
- package/dist/hooks/magic-context/boundary-execution.d.ts.map +1 -1
- package/dist/hooks/magic-context/cache-busting-signals.d.ts +1 -1
- package/dist/hooks/magic-context/cache-busting-signals.d.ts.map +1 -1
- package/dist/hooks/magic-context/channel2-delivery.d.ts.map +1 -1
- package/dist/hooks/magic-context/child-session-spawn.d.ts +26 -0
- package/dist/hooks/magic-context/child-session-spawn.d.ts.map +1 -0
- package/dist/hooks/magic-context/command-handler.d.ts +2 -0
- package/dist/hooks/magic-context/command-handler.d.ts.map +1 -1
- package/dist/hooks/magic-context/compaction-marker-manager.d.ts +49 -0
- package/dist/hooks/magic-context/compaction-marker-manager.d.ts.map +1 -1
- package/dist/hooks/magic-context/compaction-off-transition.d.ts +96 -0
- package/dist/hooks/magic-context/compaction-off-transition.d.ts.map +1 -0
- package/dist/hooks/magic-context/compartment-parser.d.ts +12 -0
- package/dist/hooks/magic-context/compartment-parser.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-historian.d.ts +2 -0
- package/dist/hooks/magic-context/compartment-runner-historian.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-incremental.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-mapping.d.ts +0 -12
- package/dist/hooks/magic-context/compartment-runner-mapping.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-partial-recomp.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-recomp.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-trigger.d.ts +12 -5
- package/dist/hooks/magic-context/compartment-trigger.d.ts.map +1 -1
- package/dist/hooks/magic-context/ctx-reduce-availability.d.ts +47 -1
- package/dist/hooks/magic-context/ctx-reduce-availability.d.ts.map +1 -1
- package/dist/hooks/magic-context/emergency-drop.d.ts +2 -2
- package/dist/hooks/magic-context/event-handler.d.ts +7 -0
- package/dist/hooks/magic-context/event-handler.d.ts.map +1 -1
- package/dist/hooks/magic-context/event-resolvers.d.ts +13 -21
- package/dist/hooks/magic-context/event-resolvers.d.ts.map +1 -1
- package/dist/hooks/magic-context/final-wire-token-estimate.d.ts +2 -0
- package/dist/hooks/magic-context/final-wire-token-estimate.d.ts.map +1 -1
- package/dist/hooks/magic-context/heuristic-cleanup.d.ts +1 -1
- package/dist/hooks/magic-context/historian-prompt.generated.d.ts +1 -1
- package/dist/hooks/magic-context/historian-prompt.generated.d.ts.map +1 -1
- package/dist/hooks/magic-context/hook-handlers.d.ts +1 -0
- package/dist/hooks/magic-context/hook-handlers.d.ts.map +1 -1
- package/dist/hooks/magic-context/hook.d.ts +11 -1
- package/dist/hooks/magic-context/hook.d.ts.map +1 -1
- package/dist/hooks/magic-context/inject-compartments.d.ts +18 -0
- package/dist/hooks/magic-context/inject-compartments.d.ts.map +1 -1
- package/dist/hooks/magic-context/protected-tail-boundary.d.ts.map +1 -1
- package/dist/hooks/magic-context/read-session-db.d.ts.map +1 -1
- package/dist/hooks/magic-context/read-session-true-raw-tokens.d.ts.map +1 -1
- package/dist/hooks/magic-context/rust-mode-transform.d.ts +3 -0
- package/dist/hooks/magic-context/rust-mode-transform.d.ts.map +1 -1
- package/dist/hooks/magic-context/send-session-notification.d.ts +20 -1
- package/dist/hooks/magic-context/send-session-notification.d.ts.map +1 -1
- package/dist/hooks/magic-context/sentinel.d.ts +39 -0
- package/dist/hooks/magic-context/sentinel.d.ts.map +1 -1
- package/dist/hooks/magic-context/tag-messages.d.ts.map +1 -1
- package/dist/hooks/magic-context/tool-drop-target.d.ts +19 -0
- package/dist/hooks/magic-context/tool-drop-target.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-compartment-phase.d.ts +3 -0
- package/dist/hooks/magic-context/transform-compartment-phase.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts +30 -0
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform.d.ts +27 -0
- package/dist/hooks/magic-context/transform.d.ts.map +1 -1
- package/dist/{index-kxz4tn6m.js → index-56yjaeb2.js} +56 -4
- package/dist/{index-bmkea2dq.js → index-b563sga5.js} +40 -287
- package/dist/{index-y1c9tcm3.js → index-cn960ffd.js} +101 -20
- package/dist/{index-k5y60ymm.js → index-dtas91s5.js} +27 -6
- package/dist/index-fcyvznch.js +279 -0
- package/dist/{index-63dq2g4d.js → index-ry8rh8cv.js} +138 -24
- package/dist/{index-h86twgsp.js → index-s0mdn690.js} +2113 -1067
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1356 -627
- package/dist/plugin/embedding-bootstrap.d.ts.map +1 -1
- package/dist/plugin/hooks/create-session-hooks.d.ts +19 -8
- package/dist/plugin/hooks/create-session-hooks.d.ts.map +1 -1
- package/dist/plugin/messages-transform.d.ts +10 -0
- package/dist/plugin/messages-transform.d.ts.map +1 -1
- package/dist/plugin/rpc-handlers.d.ts +3 -7
- package/dist/plugin/rpc-handlers.d.ts.map +1 -1
- package/dist/plugin/tool-registry.d.ts +8 -0
- package/dist/plugin/tool-registry.d.ts.map +1 -1
- package/dist/{recomp-orchestrator-yh7pepvx.js → recomp-orchestrator-8e82vmvb.js} +6 -5
- package/dist/send-session-notification-6njqewzk.js +20 -0
- package/dist/shared/conflict-detector.d.ts +38 -1
- package/dist/shared/conflict-detector.d.ts.map +1 -1
- package/dist/shared/conflict-fixer.d.ts +18 -1
- package/dist/shared/conflict-fixer.d.ts.map +1 -1
- package/dist/shared/context-limit-provenance.d.ts +3 -0
- package/dist/shared/context-limit-provenance.d.ts.map +1 -0
- package/dist/shared/escalation-bands.d.ts +9 -0
- package/dist/shared/escalation-bands.d.ts.map +1 -0
- package/dist/shared/format-threshold.d.ts +1 -1
- package/dist/shared/models-dev-cache.d.ts +29 -3
- package/dist/shared/models-dev-cache.d.ts.map +1 -1
- package/dist/shared/rpc-server.d.ts.map +1 -1
- package/dist/shared/rpc-types.d.ts +46 -1
- package/dist/shared/rpc-types.d.ts.map +1 -1
- package/dist/shared/sqlite.d.ts +9 -4
- package/dist/shared/sqlite.d.ts.map +1 -1
- package/dist/shared/storage-permissions.d.ts +5 -0
- package/dist/shared/storage-permissions.d.ts.map +1 -0
- package/dist/{storage-meta-session-1phy0b1z.js → storage-meta-session-xt41zbw4.js} +2 -1
- package/dist/{task-config-dn9k9szr.js → task-config-5nx3qfz8.js} +1 -2
- package/dist/tui/compaction-off.d.ts +13 -0
- package/dist/tui/compaction-off.d.ts.map +1 -0
- package/dist/tui/data/context-db.d.ts.map +1 -1
- package/dist/tui-compiled/compaction-off.d.ts +13 -0
- package/dist/tui-compiled/compaction-off.d.ts.map +1 -0
- package/dist/tui-compiled/data/context-db.d.ts.map +1 -1
- package/package.json +8 -3
- package/src/agents/dreamer.ts +68 -0
- package/src/agents/hidden-agent-registrations.ts +331 -0
- package/src/agents/historian.ts +3 -0
- package/src/agents/language-directive.test.ts +138 -0
- package/src/agents/language-directive.ts +121 -0
- package/src/agents/magic-context-prompt.language.test.ts +35 -0
- package/src/agents/magic-context-prompt.test.ts +292 -0
- package/src/agents/magic-context-prompt.ts +182 -0
- package/src/agents/permissions.test.ts +252 -0
- package/src/agents/permissions.ts +186 -0
- package/src/agents/sidekick.ts +1 -0
- package/src/agents/smart-note-compiler.ts +1 -0
- package/src/config/agent-disable.ts +106 -0
- package/src/config/compaction-accessor-guard.test.ts +82 -0
- package/src/config/compaction-backcompat.test.ts +52 -0
- package/src/config/index.test.ts +904 -0
- package/src/config/index.ts +601 -0
- package/src/config/migrate-config-location.test.ts +332 -0
- package/src/config/migrate-config-location.ts +635 -0
- package/src/config/migrate-dreamer-v2.test.ts +287 -0
- package/src/config/migrate-dreamer-v2.ts +336 -0
- package/src/config/migrate-experimental.ts +159 -0
- package/src/config/project-security.test.ts +366 -0
- package/src/config/project-security.ts +588 -0
- package/src/config/prune-config-leaf.test.ts +78 -0
- package/src/config/prune-config-leaf.ts +68 -0
- package/src/config/removed-config-keys.test.ts +116 -0
- package/src/config/schema/agent-overrides.ts +45 -0
- package/src/config/schema/magic-context.test.ts +358 -0
- package/src/config/schema/magic-context.ts +1002 -0
- package/src/config/transform-mode.test.ts +62 -0
- package/src/config/transform-mode.ts +34 -0
- package/src/config/variable.test.ts +323 -0
- package/src/config/variable.ts +192 -0
- package/src/features/magic-context/defaults.ts +1 -0
- package/src/features/magic-context/dreamer/cron.ts +243 -0
- package/src/features/magic-context/dreamer/task-registry.ts +104 -0
- package/src/shared/conflict-detector.test.ts +251 -1
- package/src/shared/conflict-detector.ts +84 -5
- package/src/shared/conflict-fixer.test.ts +309 -0
- package/src/shared/conflict-fixer.ts +82 -5
- package/src/shared/context-limit-provenance.ts +6 -0
- package/src/shared/escalation-bands.test.ts +23 -0
- package/src/shared/escalation-bands.ts +18 -0
- package/src/shared/format-threshold.ts +1 -1
- package/src/shared/models-dev-cache.test.ts +171 -0
- package/src/shared/models-dev-cache.ts +195 -38
- package/src/shared/rpc-server.ts +27 -18
- package/src/shared/rpc-types.ts +46 -1
- package/src/shared/sqlite.ts +13 -33
- package/src/shared/storage-permissions.ts +20 -0
- package/src/tui/compaction-off.test.ts +56 -0
- package/src/tui/compaction-off.ts +29 -0
- package/src/tui/data/context-db.ts +6 -0
- package/src/tui/index.tsx +113 -65
- package/src/tui/slots/sidebar-content.tsx +139 -83
- package/src/tui-compiled/compaction-off.ts +29 -0
- package/src/tui-compiled/data/context-db.ts +6 -0
- package/src/tui-compiled/index.tsx +558 -455
- package/src/tui-compiled/slots/sidebar-content.tsx +237 -161
- package/dist/config/schema.d.ts +0 -3
- package/dist/config/schema.d.ts.map +0 -1
- package/dist/features/magic-context/plugin-messages.d.ts +0 -75
- package/dist/features/magic-context/plugin-messages.d.ts.map +0 -1
- package/dist/hooks/magic-context/compartment-runner-state-xml.d.ts +0 -21
- package/dist/hooks/magic-context/compartment-runner-state-xml.d.ts.map +0 -1
- package/dist/index-anhrfygk.js +0 -57
- package/dist/send-session-notification-tghq9gnh.js +0 -11
- package/dist/shared/opencode-compaction-detector.d.ts +0 -2
- package/dist/shared/opencode-compaction-detector.d.ts.map +0 -1
- package/dist/shared/transcript-opencode.d.ts +0 -71
- package/dist/shared/transcript-opencode.d.ts.map +0 -1
- package/dist/tools/index.d.ts +0 -6
- package/dist/tools/index.d.ts.map +0 -1
- package/src/shared/opencode-compaction-detector.test.ts +0 -239
- package/src/shared/opencode-compaction-detector.ts +0 -81
- package/src/shared/transcript-opencode.ts +0 -302
- /package/dist/{index-v7fmc1s2.js → index-ygcng9t8.js} +0 -0
|
@@ -5,6 +5,7 @@ import packageJson from "../../../package.json"
|
|
|
5
5
|
import { badgeTextColor } from '../badge-contrast';
|
|
6
6
|
import { loadSidebarSnapshot, type SidebarSnapshot } from "../data/context-db"
|
|
7
7
|
import { formatThresholdPercent } from "../../shared/format-threshold"
|
|
8
|
+
import { compactionOffSidebarRows, nativeCompactionContextLabel } from "../compaction-off"
|
|
8
9
|
import {
|
|
9
10
|
computeEffectiveOrder,
|
|
10
11
|
DEFAULT_SLOT_ORDER,
|
|
@@ -22,10 +23,16 @@ import {
|
|
|
22
23
|
// parent-session message event (the RPC upgrade/recomp call fires none). The
|
|
23
24
|
// mounted SidebarContent registers its refresh here.
|
|
24
25
|
let activeRecompPollKick: (() => void) | null = null
|
|
26
|
+
let activeSidebarRefresh: (() => void) | null = null
|
|
25
27
|
export function kickRecompProgressRefresh(): void {
|
|
26
28
|
activeRecompPollKick?.()
|
|
27
29
|
}
|
|
28
30
|
|
|
31
|
+
/** Ask the mounted sidebar to fetch an out-of-band status update now. */
|
|
32
|
+
export function refreshSidebarSnapshot(): void {
|
|
33
|
+
activeSidebarRefresh?.()
|
|
34
|
+
}
|
|
35
|
+
|
|
29
36
|
const SINGLE_BORDER = { type: "single" } as any
|
|
30
37
|
const REFRESH_DEBOUNCE_MS = 150
|
|
31
38
|
|
|
@@ -663,11 +670,13 @@ const SidebarContent = (props: {
|
|
|
663
670
|
}
|
|
664
671
|
|
|
665
672
|
activeRecompPollKick = kickRecompPoll
|
|
673
|
+
activeSidebarRefresh = refresh
|
|
666
674
|
|
|
667
675
|
onCleanup(() => {
|
|
668
676
|
if (refreshTimer) clearTimeout(refreshTimer)
|
|
669
677
|
stopRecompPoll()
|
|
670
678
|
if (activeRecompPollKick === kickRecompPoll) activeRecompPollKick = null
|
|
679
|
+
if (activeSidebarRefresh === refresh) activeSidebarRefresh = null
|
|
671
680
|
})
|
|
672
681
|
|
|
673
682
|
// Refresh on session change
|
|
@@ -708,7 +717,9 @@ const SidebarContent = (props: {
|
|
|
708
717
|
)
|
|
709
718
|
|
|
710
719
|
const s = createMemo(() => snapshot())
|
|
720
|
+
const compactionOff = () => s()?.compaction_enabled === false
|
|
711
721
|
const contextSummaryColor = createMemo(() => {
|
|
722
|
+
if (compactionOff()) return props.theme.accent
|
|
712
723
|
const usage = s()?.usagePercentage ?? 0
|
|
713
724
|
if (usage >= 80) return props.theme.error
|
|
714
725
|
if (usage >= 65) return props.theme.warning
|
|
@@ -743,6 +754,15 @@ const SidebarContent = (props: {
|
|
|
743
754
|
<text fg={props.theme.textMuted}>v{packageJson.version}</text>
|
|
744
755
|
</box>
|
|
745
756
|
|
|
757
|
+
{/* The fence probe writes the failure into the server-owned snapshot,
|
|
758
|
+
so this survives sidebar refreshes and is visible independently of
|
|
759
|
+
the one-shot toast. */}
|
|
760
|
+
{s()?.lastTransformError && (
|
|
761
|
+
<box marginTop={1} width="100%">
|
|
762
|
+
<text fg={props.theme.error}>⚠ {s()!.lastTransformError}</text>
|
|
763
|
+
</box>
|
|
764
|
+
)}
|
|
765
|
+
|
|
746
766
|
{/* Token breakdown bar. In collapsed mode the header, bar and the
|
|
747
767
|
3 summary rows stack with no vertical padding for a compact look;
|
|
748
768
|
expanded mode keeps the 1-row gap above the bar. */}
|
|
@@ -750,16 +770,15 @@ const SidebarContent = (props: {
|
|
|
750
770
|
<box marginTop={collapsed() ? 0 : 1} flexDirection="column">
|
|
751
771
|
{(s()?.contextLimit ?? 0) > 0 && (
|
|
752
772
|
<box width="100%" flexDirection="row" justifyContent="space-between">
|
|
753
|
-
{
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
</text>
|
|
773
|
+
{compactionOff() ? (
|
|
774
|
+
<text fg={contextSummaryColor()}>
|
|
775
|
+
<b>{nativeCompactionContextLabel(s()!)}</b>
|
|
776
|
+
</text>
|
|
777
|
+
) : (
|
|
778
|
+
<text fg={contextSummaryColor()}>
|
|
779
|
+
<b>{s()!.usagePercentage.toFixed(1)}%</b> / {formatThresholdPercent(s()!.executeThreshold)}%{s()!.executeThresholdClamped ? "*" : ""}
|
|
780
|
+
</text>
|
|
781
|
+
)}
|
|
763
782
|
{/* Right: absolute token usage vs the model's
|
|
764
783
|
full context window (separate from the
|
|
765
784
|
execute threshold so users still know how
|
|
@@ -778,36 +797,47 @@ const SidebarContent = (props: {
|
|
|
778
797
|
Status (Q=queued ops, N=session notes). */}
|
|
779
798
|
{collapsed() && (
|
|
780
799
|
<box width="100%" flexDirection="column">
|
|
781
|
-
{
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
)
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
:
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
800
|
+
{compactionOff() ? (
|
|
801
|
+
compactionOffSidebarRows(s()!).map((row) => (
|
|
802
|
+
<StatRow
|
|
803
|
+
theme={props.theme}
|
|
804
|
+
label={row.label}
|
|
805
|
+
value={row.value}
|
|
806
|
+
accent={row.label === "Memories"}
|
|
807
|
+
dim={row.label !== "Memories"}
|
|
808
|
+
/>
|
|
809
|
+
))
|
|
810
|
+
) : (
|
|
811
|
+
<>
|
|
812
|
+
<box width="100%" flexDirection="row" justifyContent="space-between">
|
|
813
|
+
<text fg={props.theme.textMuted}>Historian</text>
|
|
814
|
+
{s()?.historianRunning ? (
|
|
815
|
+
<text fg={props.theme.warning}>comparting ⟳</text>
|
|
816
|
+
) : (
|
|
817
|
+
<text fg={props.theme.textMuted}>idle</text>
|
|
818
|
+
)}
|
|
819
|
+
</box>
|
|
820
|
+
<box width="100%" flexDirection="row" justifyContent="space-between">
|
|
821
|
+
<text fg={props.theme.textMuted}>Memories</text>
|
|
822
|
+
<text fg={props.theme.textMuted}>
|
|
823
|
+
{(s()?.memoryBlockCount ?? 0) > 0
|
|
824
|
+
? `${s()!.memoryBlockCount}/${s()?.memoryCount ?? 0}`
|
|
825
|
+
: String(s()?.memoryCount ?? 0)}
|
|
826
|
+
</text>
|
|
827
|
+
</box>
|
|
828
|
+
<box width="100%" flexDirection="row" justifyContent="space-between">
|
|
829
|
+
<text fg={props.theme.textMuted}>Status</text>
|
|
830
|
+
<text fg={props.theme.textMuted}>
|
|
831
|
+
C:{s()?.compartmentCount ?? 0} Q:{s()?.pendingOpsCount ?? 0} N:{s()?.sessionNoteCount ?? 0}
|
|
832
|
+
</text>
|
|
833
|
+
</box>
|
|
834
|
+
<Show when={s()?.recompProgress}>
|
|
835
|
+
{(progress) => (
|
|
836
|
+
<RecompProgressSection theme={props.theme} progress={progress()} />
|
|
837
|
+
)}
|
|
838
|
+
</Show>
|
|
839
|
+
</>
|
|
840
|
+
)}
|
|
811
841
|
</box>
|
|
812
842
|
)}
|
|
813
843
|
|
|
@@ -815,7 +845,7 @@ const SidebarContent = (props: {
|
|
|
815
845
|
{!collapsed() && (
|
|
816
846
|
<>
|
|
817
847
|
{/* Historian section */}
|
|
818
|
-
{sections().historian && (
|
|
848
|
+
{!compactionOff() && sections().historian && (
|
|
819
849
|
<>
|
|
820
850
|
<box width="100%" marginTop={1} flexDirection="row" justifyContent="space-between">
|
|
821
851
|
<text fg={props.theme.text}>
|
|
@@ -846,55 +876,81 @@ const SidebarContent = (props: {
|
|
|
846
876
|
{sections().memory && (
|
|
847
877
|
<>
|
|
848
878
|
<SectionHeader theme={props.theme} title="Memory" />
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
<StatRow
|
|
857
|
-
theme={props.theme}
|
|
858
|
-
label="Injected"
|
|
859
|
-
value={String(s()!.memoryBlockCount)}
|
|
860
|
-
dim
|
|
861
|
-
/>
|
|
862
|
-
)}
|
|
863
|
-
</>
|
|
864
|
-
)}
|
|
865
|
-
|
|
866
|
-
{/* Queue & Status */}
|
|
867
|
-
{sections().status &&
|
|
868
|
-
((s()?.pendingOpsCount ?? 0) > 0 ||
|
|
869
|
-
(s()?.sessionNoteCount ?? 0) > 0 ||
|
|
870
|
-
(s()?.readySmartNoteCount ?? 0) > 0) && (
|
|
879
|
+
{compactionOff() ? (
|
|
880
|
+
compactionOffSidebarRows(s()!)
|
|
881
|
+
.filter((row) => row.label === "Memories")
|
|
882
|
+
.map((row) => (
|
|
883
|
+
<StatRow theme={props.theme} label={row.label} value={row.value} accent />
|
|
884
|
+
))
|
|
885
|
+
) : (
|
|
871
886
|
<>
|
|
872
|
-
<
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
/>
|
|
880
|
-
)}
|
|
881
|
-
{(s()?.sessionNoteCount ?? 0) > 0 && (
|
|
882
|
-
<StatRow
|
|
883
|
-
theme={props.theme}
|
|
884
|
-
label="Notes"
|
|
885
|
-
value={String(s()!.sessionNoteCount)}
|
|
886
|
-
/>
|
|
887
|
-
)}
|
|
888
|
-
{(s()?.readySmartNoteCount ?? 0) > 0 && (
|
|
887
|
+
<StatRow
|
|
888
|
+
theme={props.theme}
|
|
889
|
+
label="Memories"
|
|
890
|
+
value={String(s()?.memoryCount ?? 0)}
|
|
891
|
+
accent
|
|
892
|
+
/>
|
|
893
|
+
{(s()?.memoryBlockCount ?? 0) > 0 && (
|
|
889
894
|
<StatRow
|
|
890
895
|
theme={props.theme}
|
|
891
|
-
label="
|
|
892
|
-
value={
|
|
893
|
-
|
|
896
|
+
label="Injected"
|
|
897
|
+
value={String(s()!.memoryBlockCount)}
|
|
898
|
+
dim
|
|
894
899
|
/>
|
|
895
900
|
)}
|
|
896
901
|
</>
|
|
897
902
|
)}
|
|
903
|
+
</>
|
|
904
|
+
)}
|
|
905
|
+
|
|
906
|
+
{/* Queue & Status */}
|
|
907
|
+
{sections().status &&
|
|
908
|
+
(compactionOff() ||
|
|
909
|
+
(s()?.pendingOpsCount ?? 0) > 0 ||
|
|
910
|
+
(s()?.sessionNoteCount ?? 0) > 0 ||
|
|
911
|
+
(s()?.readySmartNoteCount ?? 0) > 0) && (
|
|
912
|
+
<>
|
|
913
|
+
<SectionHeader theme={props.theme} title="Status" />
|
|
914
|
+
{compactionOff() ? (
|
|
915
|
+
compactionOffSidebarRows(s()!)
|
|
916
|
+
.filter((row) => row.label !== "Memories")
|
|
917
|
+
.map((row) => (
|
|
918
|
+
<StatRow
|
|
919
|
+
theme={props.theme}
|
|
920
|
+
label={row.label}
|
|
921
|
+
value={row.value}
|
|
922
|
+
dim
|
|
923
|
+
/>
|
|
924
|
+
))
|
|
925
|
+
) : (
|
|
926
|
+
<>
|
|
927
|
+
{(s()?.pendingOpsCount ?? 0) > 0 && (
|
|
928
|
+
<StatRow
|
|
929
|
+
theme={props.theme}
|
|
930
|
+
label="Queue"
|
|
931
|
+
value={`${s()!.pendingOpsCount} pending`}
|
|
932
|
+
warning
|
|
933
|
+
/>
|
|
934
|
+
)}
|
|
935
|
+
{(s()?.sessionNoteCount ?? 0) > 0 && (
|
|
936
|
+
<StatRow
|
|
937
|
+
theme={props.theme}
|
|
938
|
+
label="Notes"
|
|
939
|
+
value={String(s()!.sessionNoteCount)}
|
|
940
|
+
/>
|
|
941
|
+
)}
|
|
942
|
+
{(s()?.readySmartNoteCount ?? 0) > 0 && (
|
|
943
|
+
<StatRow
|
|
944
|
+
theme={props.theme}
|
|
945
|
+
label="Smart Notes"
|
|
946
|
+
value={`${s()!.readySmartNoteCount} ready`}
|
|
947
|
+
accent
|
|
948
|
+
/>
|
|
949
|
+
)}
|
|
950
|
+
</>
|
|
951
|
+
)}
|
|
952
|
+
</>
|
|
953
|
+
)}
|
|
898
954
|
|
|
899
955
|
{/* Dreamer */}
|
|
900
956
|
{sections().dreamer && s()?.lastDreamerRunAt && (
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { SidebarSnapshot } from "../shared/rpc-types";
|
|
2
|
+
|
|
3
|
+
export interface CompactionOffSidebarRow {
|
|
4
|
+
label: "Memories" | "Notes" | "Archived compartments";
|
|
5
|
+
value: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Formats context pressure from the current wire input and the model context
|
|
10
|
+
* limit. It deliberately does not use the stored Magic Context threshold
|
|
11
|
+
* percentage, because native compaction acts on the model window instead.
|
|
12
|
+
*/
|
|
13
|
+
export function nativeCompactionContextLabel(snapshot: SidebarSnapshot): string {
|
|
14
|
+
if (snapshot.contextLimit <= 0) return "Context: unknown · native compaction";
|
|
15
|
+
const percentage = (snapshot.inputTokens / snapshot.contextLimit) * 100;
|
|
16
|
+
return `Context: ${percentage.toFixed(1)}% · native compaction`;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function compactionOffSidebarRows(snapshot: SidebarSnapshot): CompactionOffSidebarRow[] {
|
|
20
|
+
const rows: CompactionOffSidebarRow[] = [
|
|
21
|
+
{ label: "Memories", value: String(snapshot.memoryCount) },
|
|
22
|
+
{ label: "Notes", value: String(snapshot.sessionNoteCount) },
|
|
23
|
+
];
|
|
24
|
+
const archivedCount = snapshot.archivedCompartmentCount ?? 0;
|
|
25
|
+
if (archivedCount > 0) {
|
|
26
|
+
rows.push({ label: "Archived compartments", value: String(archivedCount) });
|
|
27
|
+
}
|
|
28
|
+
return rows;
|
|
29
|
+
}
|
|
@@ -65,6 +65,7 @@ const EMPTY_SNAPSHOT: SidebarSnapshot = {
|
|
|
65
65
|
sessionNoteCount: 0,
|
|
66
66
|
readySmartNoteCount: 0,
|
|
67
67
|
cacheTtl: "5m",
|
|
68
|
+
lastTransformError: null,
|
|
68
69
|
lastDreamerRunAt: null,
|
|
69
70
|
projectIdentity: null,
|
|
70
71
|
compartmentTokens: 0,
|
|
@@ -194,6 +195,7 @@ export async function loadStatusDetail(
|
|
|
194
195
|
cacheTtlMs: 0,
|
|
195
196
|
cacheRemainingMs: 0,
|
|
196
197
|
cacheExpired: false,
|
|
198
|
+
cacheNeverExpires: false,
|
|
197
199
|
executeThreshold: 65,
|
|
198
200
|
executeThresholdMode: "percentage",
|
|
199
201
|
protectedTagCount: 20,
|
|
@@ -202,6 +204,10 @@ export async function loadStatusDetail(
|
|
|
202
204
|
compressionBudget: null,
|
|
203
205
|
compressionUsage: null,
|
|
204
206
|
toastDurationMs: 5000,
|
|
207
|
+
storage_versions: {
|
|
208
|
+
context_db_schema_version: null,
|
|
209
|
+
plugin_supported_version: 0,
|
|
210
|
+
},
|
|
205
211
|
};
|
|
206
212
|
|
|
207
213
|
if (!rpcClient) return emptyDetail;
|