@cortexkit/opencode-magic-context 0.36.1 → 0.38.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 -0
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/project-security.d.ts +2 -1
- package/dist/config/project-security.d.ts.map +1 -1
- package/dist/config/schema/magic-context.d.ts +10 -0
- package/dist/config/schema/magic-context.d.ts.map +1 -1
- package/dist/{conflict-warning-hook-mt0ttc4x.js → conflict-warning-hook-an4fxhwf.js} +3 -3
- package/dist/{derive-budgets-88mxk2w1.js → derive-budgets-da4yg3tz.js} +3 -2
- package/dist/features/magic-context/context-authority.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/classify-prompt.d.ts +5 -1
- package/dist/features/magic-context/dreamer/classify-prompt.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/manifest-parser.d.ts +8 -0
- package/dist/features/magic-context/dreamer/manifest-parser.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/map-memories-prompt.d.ts +7 -1
- package/dist/features/magic-context/dreamer/map-memories-prompt.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/map-memories.d.ts +18 -0
- package/dist/features/magic-context/dreamer/map-memories.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/storage-dream-runs.d.ts +5 -0
- package/dist/features/magic-context/dreamer/storage-dream-runs.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/task-executor.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/verify-prompt.d.ts +5 -1
- package/dist/features/magic-context/dreamer/verify-prompt.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 +6 -1
- package/dist/features/magic-context/fail-closed-block.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-openai.d.ts +3 -1
- package/dist/features/magic-context/memory/embedding-openai.d.ts.map +1 -1
- package/dist/features/magic-context/memory/project-identity.d.ts +6 -0
- package/dist/features/magic-context/memory/project-identity.d.ts.map +1 -1
- package/dist/features/magic-context/migrations.d.ts.map +1 -1
- package/dist/features/magic-context/overflow-detection.d.ts.map +1 -1
- package/dist/features/magic-context/reclaim-protection.d.ts +13 -0
- package/dist/features/magic-context/reclaim-protection.d.ts.map +1 -0
- package/dist/features/magic-context/smart-notes/runner.d.ts.map +1 -1
- package/dist/features/magic-context/smart-notes/wake-plane.d.ts +21 -0
- package/dist/features/magic-context/smart-notes/wake-plane.d.ts.map +1 -0
- package/dist/features/magic-context/storage-db.d.ts +19 -3
- package/dist/features/magic-context/storage-db.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta-persisted.d.ts +23 -0
- package/dist/features/magic-context/storage-meta-persisted.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta-session.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta-shared.d.ts.map +1 -1
- package/dist/features/magic-context/storage-primers.d.ts +11 -0
- package/dist/features/magic-context/storage-primers.d.ts.map +1 -1
- package/dist/features/magic-context/storage-schema-helpers.d.ts.map +1 -1
- package/dist/features/magic-context/storage-tags.d.ts +13 -5
- package/dist/features/magic-context/storage-tags.d.ts.map +1 -1
- package/dist/features/magic-context/user-memory/storage-user-memory.d.ts +7 -0
- package/dist/features/magic-context/user-memory/storage-user-memory.d.ts.map +1 -1
- package/dist/features/magic-context/window-report-ledger.d.ts +70 -0
- package/dist/features/magic-context/window-report-ledger.d.ts.map +1 -0
- package/dist/hooks/auto-update-checker/checker.d.ts +8 -1
- package/dist/hooks/auto-update-checker/checker.d.ts.map +1 -1
- package/dist/hooks/auto-update-checker/index.d.ts.map +1 -1
- package/dist/hooks/magic-context/channel2-cycle.d.ts +16 -0
- package/dist/hooks/magic-context/channel2-cycle.d.ts.map +1 -0
- package/dist/hooks/magic-context/channel2-delivery.d.ts +3 -9
- package/dist/hooks/magic-context/channel2-delivery.d.ts.map +1 -1
- 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/ctx-reduce-nudge.d.ts +33 -103
- package/dist/hooks/magic-context/ctx-reduce-nudge.d.ts.map +1 -1
- package/dist/hooks/magic-context/emergency-drop.d.ts.map +1 -1
- package/dist/hooks/magic-context/event-handler.d.ts.map +1 -1
- package/dist/hooks/magic-context/event-resolvers.d.ts +4 -0
- package/dist/hooks/magic-context/event-resolvers.d.ts.map +1 -1
- package/dist/hooks/magic-context/execute-status.d.ts +3 -1
- package/dist/hooks/magic-context/execute-status.d.ts.map +1 -1
- package/dist/hooks/magic-context/fold-execution-gate.d.ts +2 -0
- package/dist/hooks/magic-context/fold-execution-gate.d.ts.map +1 -0
- package/dist/hooks/magic-context/hook-handlers.d.ts.map +1 -1
- package/dist/hooks/magic-context/hook.d.ts.map +1 -1
- package/dist/hooks/magic-context/inject-compartments.d.ts.map +1 -1
- package/dist/hooks/magic-context/live-session-state.d.ts +3 -0
- package/dist/hooks/magic-context/live-session-state.d.ts.map +1 -1
- package/dist/hooks/magic-context/lkg-replay.d.ts.map +1 -1
- package/dist/hooks/magic-context/lkg-slot.d.ts +20 -0
- package/dist/hooks/magic-context/lkg-slot.d.ts.map +1 -1
- package/dist/hooks/magic-context/module-state-sync.d.ts +8 -0
- package/dist/hooks/magic-context/module-state-sync.d.ts.map +1 -1
- package/dist/hooks/magic-context/module-transport.d.ts.map +1 -1
- package/dist/hooks/magic-context/module-wire.d.ts +6 -1
- package/dist/hooks/magic-context/module-wire.d.ts.map +1 -1
- package/dist/hooks/magic-context/rust-mode-transform.d.ts +21 -2
- package/dist/hooks/magic-context/rust-mode-transform.d.ts.map +1 -1
- package/dist/hooks/magic-context/strip-content.d.ts +27 -0
- package/dist/hooks/magic-context/strip-content.d.ts.map +1 -1
- package/dist/hooks/magic-context/supersession-reclaim.d.ts.map +1 -1
- package/dist/hooks/magic-context/system-prompt-hash.d.ts.map +1 -1
- package/dist/hooks/magic-context/tail-hygiene-walk.d.ts +78 -0
- package/dist/hooks/magic-context/tail-hygiene-walk.d.ts.map +1 -0
- package/dist/hooks/magic-context/tool-reclaim.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts +14 -3
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform.d.ts +10 -0
- package/dist/hooks/magic-context/transform.d.ts.map +1 -1
- package/dist/hooks/magic-context/wrapup-orchestrator.d.ts.map +1 -1
- package/dist/{index-nsx2n9eg.js → index-4cz5nfxf.js} +3 -3
- package/dist/{index-f1tnb3vm.js → index-8pqfcghm.js} +21 -9
- package/dist/index-9zhhvr4w.js +733 -0
- package/dist/{index-zp6x6s6a.js → index-cae89eas.js} +25 -6
- package/dist/index-cgyfn1s2.js +53 -0
- package/dist/{index-3zqcdwqr.js → index-crke4z5j.js} +7 -4
- package/dist/{index-1skzp4dc.js → index-mmvhrqqb.js} +1991 -274
- package/dist/{index-tsgs7td8.js → index-pck9vadr.js} +1 -1
- package/dist/{index-3tnkymva.js → index-sw8gnq34.js} +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1714 -988
- package/dist/plugin/hooks/create-session-hooks.d.ts +3 -0
- package/dist/plugin/hooks/create-session-hooks.d.ts.map +1 -1
- package/dist/plugin/messages-transform.d.ts.map +1 -1
- package/dist/plugin/rpc-handlers.d.ts +2 -0
- package/dist/plugin/rpc-handlers.d.ts.map +1 -1
- package/dist/{recomp-orchestrator-a0g9b52q.js → recomp-orchestrator-jsde4ygw.js} +7 -6
- package/dist/{safe-notification-target-c11fdda2.js → safe-notification-target-b693f9x3.js} +2 -2
- package/dist/{send-session-notification-bgtf4853.js → send-session-notification-dxske5zm.js} +3 -3
- package/dist/shared/conflict-detector.d.ts +63 -0
- package/dist/shared/conflict-detector.d.ts.map +1 -1
- package/dist/shared/harness-provider-map.d.ts +8 -0
- package/dist/shared/harness-provider-map.d.ts.map +1 -1
- package/dist/shared/logger.d.ts +8 -0
- package/dist/shared/logger.d.ts.map +1 -1
- package/dist/shared/models-dev-cache.d.ts +7 -0
- package/dist/shared/models-dev-cache.d.ts.map +1 -1
- package/dist/shared/prompt-surface-runtime.d.ts.map +1 -1
- package/dist/shared/prompt-surface.d.ts +2 -0
- package/dist/shared/prompt-surface.d.ts.map +1 -1
- package/dist/shared/rpc-client.d.ts.map +1 -1
- package/dist/shared/rpc-server.d.ts.map +1 -1
- package/dist/shared/rpc-types.d.ts +29 -0
- package/dist/shared/rpc-types.d.ts.map +1 -1
- package/dist/shared/rpc-utils.d.ts +28 -9
- package/dist/shared/rpc-utils.d.ts.map +1 -1
- package/dist/shared/tail-hygiene-status.d.ts +15 -0
- package/dist/shared/tail-hygiene-status.d.ts.map +1 -0
- package/dist/shared/window-geometry.d.ts +90 -0
- package/dist/shared/window-geometry.d.ts.map +1 -0
- package/dist/{storage-meta-session-df9tstzr.js → storage-meta-session-mk4gsnke.js} +4 -3
- package/dist/tools/ctx-memory/tools.d.ts.map +1 -1
- package/dist/tools/ctx-note/tools.d.ts.map +1 -1
- package/dist/tui/data/context-db.d.ts.map +1 -1
- package/dist/tui-compiled/data/context-db.d.ts.map +1 -1
- package/package.json +3 -1
- package/src/config/index.ts +2 -0
- package/src/config/latch-permanence-guard.test.ts +218 -0
- package/src/config/project-security.ts +10 -1
- package/src/config/schema/magic-context.ts +12 -2
- package/src/shared/__fixtures__/window-overlay.v1.json +337 -0
- package/src/shared/conflict-detector.test.ts +176 -1
- package/src/shared/conflict-detector.ts +126 -3
- package/src/shared/harness-provider-map.test.ts +20 -0
- package/src/shared/harness-provider-map.ts +19 -0
- package/src/shared/logger.test.ts +119 -0
- package/src/shared/logger.ts +33 -15
- package/src/shared/models-dev-cache.test.ts +42 -0
- package/src/shared/models-dev-cache.ts +62 -9
- package/src/shared/prompt-surface-runtime.ts +5 -3
- package/src/shared/prompt-surface.test.ts +38 -0
- package/src/shared/prompt-surface.ts +15 -2
- package/src/shared/rpc-client.ts +4 -2
- package/src/shared/rpc-server.ts +1 -0
- package/src/shared/rpc-types.ts +30 -0
- package/src/shared/rpc-utils.test.ts +162 -13
- package/src/shared/rpc-utils.ts +224 -31
- package/src/shared/tail-hygiene-status.ts +57 -0
- package/src/shared/window-geometry.test.ts +342 -0
- package/src/shared/window-geometry.ts +626 -0
- package/src/tui/data/context-db.ts +5 -0
- package/src/tui/index.tsx +33 -1
- package/src/tui/slots/sidebar-content.tsx +17 -5
- package/src/tui-compiled/data/context-db.ts +5 -0
- package/src/tui-compiled/index.tsx +359 -273
- package/src/tui-compiled/slots/sidebar-content.tsx +316 -287
- package/dist/index-wgvxkqpx.js +0 -342
package/src/tui/index.tsx
CHANGED
|
@@ -11,6 +11,8 @@ import packageJson from "../../package.json"
|
|
|
11
11
|
import { closeRpc, dismissUpgradeReminder, getAnnouncement, getCompartmentCount, getRpcGeneration, initRpcClient, loadEmbedDetail, loadStatusDetail, loadToastDurationMs, markAnnounced, requestRecomp, requestUpgrade, type EmbedDetail, type StatusDetail } from "./data/context-db"
|
|
12
12
|
import { startNotificationSocket, stopNotificationSocket, type SocketNotification } from "./data/notification-socket"
|
|
13
13
|
import { formatThresholdPercent } from "../shared/format-threshold"
|
|
14
|
+
import { formatTailHygiene } from "../shared/tail-hygiene-status"
|
|
15
|
+
import { formatWindowDerivationLine } from "../shared/window-geometry"
|
|
14
16
|
import { compactionOffSidebarRows, nativeCompactionContextLabel } from "./compaction-off"
|
|
15
17
|
import { isCompactionEnabled } from "../config/agent-disable"
|
|
16
18
|
import { loadPluginConfig } from "../config"
|
|
@@ -201,7 +203,7 @@ const StatusDialog = (props: { api: TuiPluginApi; s: StatusDetail }) => {
|
|
|
201
203
|
segs.push({ label: "User Profile", tokens: d.profileTokens, color: COLORS.profile })
|
|
202
204
|
|
|
203
205
|
if (d.conversationTokens > 0)
|
|
204
|
-
segs.push({ label: "Conversation", tokens: d.conversationTokens, color: COLORS.conversation })
|
|
206
|
+
segs.push({ label: "Conversation*", tokens: d.conversationTokens, color: COLORS.conversation })
|
|
205
207
|
if (d.toolCallTokens > 0)
|
|
206
208
|
segs.push({ label: "Tool Calls", tokens: d.toolCallTokens, color: COLORS.toolCalls })
|
|
207
209
|
if (d.toolDefinitionTokens > 0)
|
|
@@ -239,6 +241,11 @@ const StatusDialog = (props: { api: TuiPluginApi; s: StatusDetail }) => {
|
|
|
239
241
|
{fmt(s().inputTokens)} / {contextLimit() > 0 ? fmt(contextLimit()) : "?"} tokens
|
|
240
242
|
</text>
|
|
241
243
|
</box>
|
|
244
|
+
{s().windowGeometry && (
|
|
245
|
+
<text fg={t().textMuted}>
|
|
246
|
+
{formatWindowDerivationLine(s().inputTokens, s().windowGeometry!)}
|
|
247
|
+
</text>
|
|
248
|
+
)}
|
|
242
249
|
|
|
243
250
|
{/* Segmented breakdown bar: flex row of colored boxes filling
|
|
244
251
|
the dialog width. See barSegments comment above. */}
|
|
@@ -265,6 +272,15 @@ const StatusDialog = (props: { api: TuiPluginApi; s: StatusDetail }) => {
|
|
|
265
272
|
</box>
|
|
266
273
|
)
|
|
267
274
|
})}
|
|
275
|
+
<text fg={t().textMuted}>* Conversation includes Reasoning; hygiene excludes it</text>
|
|
276
|
+
{s().tailHygiene !== undefined && (
|
|
277
|
+
<R
|
|
278
|
+
t={t()}
|
|
279
|
+
l="Hygiene"
|
|
280
|
+
v={formatTailHygiene(s().tailHygiene!)}
|
|
281
|
+
fg={s().tailHygiene!.evaluable ? t().accent : t().warning}
|
|
282
|
+
/>
|
|
283
|
+
)}
|
|
268
284
|
</box>
|
|
269
285
|
|
|
270
286
|
{/* Recomp / session-upgrade live progress (full width, only while
|
|
@@ -388,6 +404,22 @@ const StatusDialog = (props: { api: TuiPluginApi; s: StatusDetail }) => {
|
|
|
388
404
|
</box>
|
|
389
405
|
)}
|
|
390
406
|
|
|
407
|
+
<box marginTop={1} width="100%">
|
|
408
|
+
<text fg={t().text}><b>Logger</b></text>
|
|
409
|
+
<R
|
|
410
|
+
t={t()}
|
|
411
|
+
l="Swallowed writes"
|
|
412
|
+
v={String(s().loggerDiagnostics?.swallowedWriteCount ?? 0)}
|
|
413
|
+
fg={(s().loggerDiagnostics?.swallowedWriteCount ?? 0) > 0 ? t().error : t().textMuted}
|
|
414
|
+
/>
|
|
415
|
+
{s().loggerDiagnostics?.lastErrorMessage && (
|
|
416
|
+
<R t={t()} l="Last error" v={s().loggerDiagnostics.lastErrorMessage} fg={t().error} />
|
|
417
|
+
)}
|
|
418
|
+
{s().loggerDiagnostics?.lastErrorTime && (
|
|
419
|
+
<R t={t()} l="Last error time" v={s().loggerDiagnostics.lastErrorTime} fg={t().textMuted} />
|
|
420
|
+
)}
|
|
421
|
+
</box>
|
|
422
|
+
|
|
391
423
|
{/* Footer */}
|
|
392
424
|
<box marginTop={1} justifyContent="flex-end" width="100%">
|
|
393
425
|
<text fg={t().textMuted}>Esc to close</text>
|
|
@@ -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 { formatTailHygiene } from "../../shared/tail-hygiene-status"
|
|
8
9
|
import { compactionOffSidebarRows, nativeCompactionContextLabel } from "../compaction-off"
|
|
9
10
|
import {
|
|
10
11
|
computeEffectiveOrder,
|
|
@@ -239,7 +240,7 @@ const TokenBreakdown = (props: {
|
|
|
239
240
|
key: "conv",
|
|
240
241
|
tokens: s.conversationTokens,
|
|
241
242
|
color: COLORS.conversation,
|
|
242
|
-
label: "Conversation",
|
|
243
|
+
label: "Conversation*",
|
|
243
244
|
})
|
|
244
245
|
|
|
245
246
|
// Tool Calls = tool_use/tool_result/tool/tool-invocation parts in messages
|
|
@@ -320,6 +321,7 @@ const TokenBreakdown = (props: {
|
|
|
320
321
|
</box>
|
|
321
322
|
)
|
|
322
323
|
})}
|
|
324
|
+
<text fg={props.theme.textMuted}>* includes Reasoning; hygiene excludes it</text>
|
|
323
325
|
</box>
|
|
324
326
|
)}
|
|
325
327
|
</box>
|
|
@@ -787,16 +789,26 @@ const SidebarContent = (props: {
|
|
|
787
789
|
<b>{s()!.usagePercentage.toFixed(1)}%</b> / {formatThresholdPercent(s()!.executeThreshold)}%{s()!.executeThresholdClamped ? "*" : ""}
|
|
788
790
|
</text>
|
|
789
791
|
)}
|
|
790
|
-
{/* Right: absolute token usage
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
much headroom remains beyond compaction). */}
|
|
792
|
+
{/* Right: absolute token usage against the usable
|
|
793
|
+
scheduler window — the same denominator as the
|
|
794
|
+
percentage and nudge/trigger scheduling. */}
|
|
794
795
|
<text fg={contextSummaryColor()}>
|
|
795
796
|
{compactTokens(s()!.inputTokens)} / {compactTokens(s()!.contextLimit)}
|
|
796
797
|
</text>
|
|
797
798
|
</box>
|
|
798
799
|
)}
|
|
799
800
|
<TokenBreakdown theme={props.theme} snapshot={s()!} collapsed={collapsed()} />
|
|
801
|
+
{!collapsed() && (
|
|
802
|
+
<text fg={props.theme.textMuted}>Conversation includes reasoning estimates; hygiene excludes reasoning.</text>
|
|
803
|
+
)}
|
|
804
|
+
{s()!.tailHygiene !== undefined && (
|
|
805
|
+
<StatRow
|
|
806
|
+
theme={props.theme}
|
|
807
|
+
label="Hygiene"
|
|
808
|
+
value={formatTailHygiene(s()!.tailHygiene!)}
|
|
809
|
+
warning={!s()!.tailHygiene!.evaluable}
|
|
810
|
+
/>
|
|
811
|
+
)}
|
|
800
812
|
</box>
|
|
801
813
|
)}
|
|
802
814
|
|
|
@@ -204,6 +204,11 @@ export async function loadStatusDetail(
|
|
|
204
204
|
compressionBudget: null,
|
|
205
205
|
compressionUsage: null,
|
|
206
206
|
toastDurationMs: 5000,
|
|
207
|
+
loggerDiagnostics: {
|
|
208
|
+
swallowedWriteCount: 0,
|
|
209
|
+
lastErrorMessage: null,
|
|
210
|
+
lastErrorTime: null,
|
|
211
|
+
},
|
|
207
212
|
storage_versions: {
|
|
208
213
|
context_db_schema_version: null,
|
|
209
214
|
plugin_supported_version: 0,
|