@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
|
@@ -12,6 +12,7 @@ import packageJson from "../../../package.json";
|
|
|
12
12
|
import { badgeTextColor } from "../badge-contrast";
|
|
13
13
|
import { loadSidebarSnapshot } from "../data/context-db";
|
|
14
14
|
import { formatThresholdPercent } from "../../shared/format-threshold";
|
|
15
|
+
import { compactionOffSidebarRows, nativeCompactionContextLabel } from "../compaction-off";
|
|
15
16
|
import { computeEffectiveOrder, DEFAULT_SLOT_ORDER, PLUGIN_KEY, queueTuiPreferenceUpdate, readTuiPreferencesFile, readTuiPreferencesFileSync, resolveMagicContextPrefs, watchTuiPreferences } from "../../shared/tui-preferences";
|
|
16
17
|
|
|
17
18
|
// Module-level hook so the upgrade/recomp dialog can kick the sidebar into its
|
|
@@ -19,9 +20,15 @@ import { computeEffectiveOrder, DEFAULT_SLOT_ORDER, PLUGIN_KEY, queueTuiPreferen
|
|
|
19
20
|
// parent-session message event (the RPC upgrade/recomp call fires none). The
|
|
20
21
|
// mounted SidebarContent registers its refresh here.
|
|
21
22
|
let activeRecompPollKick = null;
|
|
23
|
+
let activeSidebarRefresh = null;
|
|
22
24
|
export function kickRecompProgressRefresh() {
|
|
23
25
|
activeRecompPollKick?.();
|
|
24
26
|
}
|
|
27
|
+
|
|
28
|
+
/** Ask the mounted sidebar to fetch an out-of-band status update now. */
|
|
29
|
+
export function refreshSidebarSnapshot() {
|
|
30
|
+
activeSidebarRefresh?.();
|
|
31
|
+
}
|
|
25
32
|
const SINGLE_BORDER = {
|
|
26
33
|
type: "single"
|
|
27
34
|
};
|
|
@@ -672,10 +679,12 @@ const SidebarContent = props => {
|
|
|
672
679
|
recompTick();
|
|
673
680
|
}
|
|
674
681
|
activeRecompPollKick = kickRecompPoll;
|
|
682
|
+
activeSidebarRefresh = refresh;
|
|
675
683
|
onCleanup(() => {
|
|
676
684
|
if (refreshTimer) clearTimeout(refreshTimer);
|
|
677
685
|
stopRecompPoll();
|
|
678
686
|
if (activeRecompPollKick === kickRecompPoll) activeRecompPollKick = null;
|
|
687
|
+
if (activeSidebarRefresh === refresh) activeSidebarRefresh = null;
|
|
679
688
|
});
|
|
680
689
|
|
|
681
690
|
// Refresh on session change
|
|
@@ -704,7 +713,9 @@ const SidebarContent = props => {
|
|
|
704
713
|
defer: false
|
|
705
714
|
}));
|
|
706
715
|
const s = createMemo(() => snapshot());
|
|
716
|
+
const compactionOff = () => s()?.compaction_enabled === false;
|
|
707
717
|
const contextSummaryColor = createMemo(() => {
|
|
718
|
+
if (compactionOff()) return props.theme.accent;
|
|
708
719
|
const usage = s()?.usagePercentage ?? 0;
|
|
709
720
|
if (usage >= 80) return props.theme.error;
|
|
710
721
|
if (usage >= 65) return props.theme.warning;
|
|
@@ -741,50 +752,69 @@ const SidebarContent = props => {
|
|
|
741
752
|
_$insertNode(_el$30, _el$31);
|
|
742
753
|
_$insert(_el$30, () => packageJson.version, null);
|
|
743
754
|
_$insert(_el$25, (() => {
|
|
744
|
-
var _c$2 = _$memo(() => !!
|
|
755
|
+
var _c$2 = _$memo(() => !!s()?.lastTransformError);
|
|
745
756
|
return () => _c$2() && (() => {
|
|
746
|
-
var _el$32 = _$createElement("box")
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
_$
|
|
770
|
-
_$
|
|
771
|
-
_$
|
|
772
|
-
_$
|
|
773
|
-
_$insert(_el$
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
757
|
+
var _el$32 = _$createElement("box"),
|
|
758
|
+
_el$33 = _$createElement("text"),
|
|
759
|
+
_el$34 = _$createTextNode(`⚠ `);
|
|
760
|
+
_$insertNode(_el$32, _el$33);
|
|
761
|
+
_$setProp(_el$32, "marginTop", 1);
|
|
762
|
+
_$setProp(_el$32, "width", "100%");
|
|
763
|
+
_$insertNode(_el$33, _el$34);
|
|
764
|
+
_$insert(_el$33, () => s().lastTransformError, null);
|
|
765
|
+
_$effect(_$p => _$setProp(_el$33, "fg", props.theme.error, _$p));
|
|
766
|
+
return _el$32;
|
|
767
|
+
})();
|
|
768
|
+
})(), null);
|
|
769
|
+
_$insert(_el$25, (() => {
|
|
770
|
+
var _c$3 = _$memo(() => !!(s() && s().inputTokens > 0));
|
|
771
|
+
return () => _c$3() && (() => {
|
|
772
|
+
var _el$35 = _$createElement("box");
|
|
773
|
+
_$setProp(_el$35, "flexDirection", "column");
|
|
774
|
+
_$insert(_el$35, (() => {
|
|
775
|
+
var _c$6 = _$memo(() => (s()?.contextLimit ?? 0) > 0);
|
|
776
|
+
return () => _c$6() && (() => {
|
|
777
|
+
var _el$36 = _$createElement("box"),
|
|
778
|
+
_el$37 = _$createElement("text"),
|
|
779
|
+
_el$38 = _$createTextNode(` / `);
|
|
780
|
+
_$insertNode(_el$36, _el$37);
|
|
781
|
+
_$setProp(_el$36, "width", "100%");
|
|
782
|
+
_$setProp(_el$36, "flexDirection", "row");
|
|
783
|
+
_$setProp(_el$36, "justifyContent", "space-between");
|
|
784
|
+
_$insert(_el$36, (() => {
|
|
785
|
+
var _c$7 = _$memo(() => !!compactionOff());
|
|
786
|
+
return () => _c$7() ? (() => {
|
|
787
|
+
var _el$39 = _$createElement("text"),
|
|
788
|
+
_el$40 = _$createElement("b");
|
|
789
|
+
_$insertNode(_el$39, _el$40);
|
|
790
|
+
_$insert(_el$40, () => nativeCompactionContextLabel(s()));
|
|
791
|
+
_$effect(_$p => _$setProp(_el$39, "fg", contextSummaryColor(), _$p));
|
|
792
|
+
return _el$39;
|
|
793
|
+
})() : (() => {
|
|
794
|
+
var _el$41 = _$createElement("text"),
|
|
795
|
+
_el$42 = _$createElement("b"),
|
|
796
|
+
_el$43 = _$createTextNode(`%`),
|
|
797
|
+
_el$44 = _$createTextNode(` / `),
|
|
798
|
+
_el$45 = _$createTextNode(`%`);
|
|
799
|
+
_$insertNode(_el$41, _el$42);
|
|
800
|
+
_$insertNode(_el$41, _el$44);
|
|
801
|
+
_$insertNode(_el$41, _el$45);
|
|
802
|
+
_$insertNode(_el$42, _el$43);
|
|
803
|
+
_$insert(_el$42, () => s().usagePercentage.toFixed(1), _el$43);
|
|
804
|
+
_$insert(_el$41, () => formatThresholdPercent(s().executeThreshold), _el$45);
|
|
805
|
+
_$insert(_el$41, () => s().executeThresholdClamped ? "*" : "", null);
|
|
806
|
+
_$effect(_$p => _$setProp(_el$41, "fg", contextSummaryColor(), _$p));
|
|
807
|
+
return _el$41;
|
|
808
|
+
})();
|
|
809
|
+
})(), _el$37);
|
|
810
|
+
_$insertNode(_el$37, _el$38);
|
|
811
|
+
_$insert(_el$37, () => compactTokens(s().inputTokens), _el$38);
|
|
812
|
+
_$insert(_el$37, () => compactTokens(s().contextLimit), null);
|
|
813
|
+
_$effect(_$p => _$setProp(_el$37, "fg", contextSummaryColor(), _$p));
|
|
814
|
+
return _el$36;
|
|
785
815
|
})();
|
|
786
816
|
})(), null);
|
|
787
|
-
_$insert(_el$
|
|
817
|
+
_$insert(_el$35, _$createComponent(TokenBreakdown, {
|
|
788
818
|
get theme() {
|
|
789
819
|
return props.theme;
|
|
790
820
|
},
|
|
@@ -795,135 +825,159 @@ const SidebarContent = props => {
|
|
|
795
825
|
return collapsed();
|
|
796
826
|
}
|
|
797
827
|
}), null);
|
|
798
|
-
_$effect(_$p => _$setProp(_el$
|
|
799
|
-
return _el$
|
|
828
|
+
_$effect(_$p => _$setProp(_el$35, "marginTop", collapsed() ? 0 : 1, _$p));
|
|
829
|
+
return _el$35;
|
|
800
830
|
})();
|
|
801
831
|
})(), null);
|
|
802
832
|
_$insert(_el$25, (() => {
|
|
803
|
-
var _c$
|
|
804
|
-
return () => _c$
|
|
805
|
-
var _el$
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
_el$49 = _$createElement("box"),
|
|
812
|
-
_el$50 = _$createElement("text"),
|
|
813
|
-
_el$52 = _$createElement("text"),
|
|
814
|
-
_el$53 = _$createTextNode(`C:`),
|
|
815
|
-
_el$54 = _$createTextNode(` Q:`),
|
|
816
|
-
_el$55 = _$createTextNode(` N:`);
|
|
817
|
-
_$insertNode(_el$41, _el$42);
|
|
818
|
-
_$insertNode(_el$41, _el$45);
|
|
819
|
-
_$insertNode(_el$41, _el$49);
|
|
820
|
-
_$setProp(_el$41, "width", "100%");
|
|
821
|
-
_$setProp(_el$41, "flexDirection", "column");
|
|
822
|
-
_$insertNode(_el$42, _el$43);
|
|
823
|
-
_$setProp(_el$42, "width", "100%");
|
|
824
|
-
_$setProp(_el$42, "flexDirection", "row");
|
|
825
|
-
_$setProp(_el$42, "justifyContent", "space-between");
|
|
826
|
-
_$insertNode(_el$43, _$createTextNode(`Historian`));
|
|
827
|
-
_$insert(_el$42, (() => {
|
|
828
|
-
var _c$6 = _$memo(() => !!s()?.historianRunning);
|
|
829
|
-
return () => _c$6() ? (() => {
|
|
830
|
-
var _el$56 = _$createElement("text");
|
|
831
|
-
_$insertNode(_el$56, _$createTextNode(`comparting ⟳`));
|
|
832
|
-
_$effect(_$p => _$setProp(_el$56, "fg", props.theme.warning, _$p));
|
|
833
|
-
return _el$56;
|
|
834
|
-
})() : (() => {
|
|
835
|
-
var _el$58 = _$createElement("text");
|
|
836
|
-
_$insertNode(_el$58, _$createTextNode(`idle`));
|
|
837
|
-
_$effect(_$p => _$setProp(_el$58, "fg", props.theme.textMuted, _$p));
|
|
838
|
-
return _el$58;
|
|
839
|
-
})();
|
|
840
|
-
})(), null);
|
|
841
|
-
_$insertNode(_el$45, _el$46);
|
|
842
|
-
_$insertNode(_el$45, _el$48);
|
|
843
|
-
_$setProp(_el$45, "width", "100%");
|
|
844
|
-
_$setProp(_el$45, "flexDirection", "row");
|
|
845
|
-
_$setProp(_el$45, "justifyContent", "space-between");
|
|
846
|
-
_$insertNode(_el$46, _$createTextNode(`Memories`));
|
|
847
|
-
_$insert(_el$48, (() => {
|
|
848
|
-
var _c$7 = _$memo(() => (s()?.memoryBlockCount ?? 0) > 0);
|
|
849
|
-
return () => _c$7() ? `${s().memoryBlockCount}/${s()?.memoryCount ?? 0}` : String(s()?.memoryCount ?? 0);
|
|
850
|
-
})());
|
|
851
|
-
_$insertNode(_el$49, _el$50);
|
|
852
|
-
_$insertNode(_el$49, _el$52);
|
|
853
|
-
_$setProp(_el$49, "width", "100%");
|
|
854
|
-
_$setProp(_el$49, "flexDirection", "row");
|
|
855
|
-
_$setProp(_el$49, "justifyContent", "space-between");
|
|
856
|
-
_$insertNode(_el$50, _$createTextNode(`Status`));
|
|
857
|
-
_$insertNode(_el$52, _el$53);
|
|
858
|
-
_$insertNode(_el$52, _el$54);
|
|
859
|
-
_$insertNode(_el$52, _el$55);
|
|
860
|
-
_$insert(_el$52, () => s()?.compartmentCount ?? 0, _el$54);
|
|
861
|
-
_$insert(_el$52, () => s()?.pendingOpsCount ?? 0, _el$55);
|
|
862
|
-
_$insert(_el$52, () => s()?.sessionNoteCount ?? 0, null);
|
|
863
|
-
_$insert(_el$41, _$createComponent(Show, {
|
|
864
|
-
get when() {
|
|
865
|
-
return s()?.recompProgress;
|
|
866
|
-
},
|
|
867
|
-
children: progress => _$createComponent(RecompProgressSection, {
|
|
833
|
+
var _c$4 = _$memo(() => !!collapsed());
|
|
834
|
+
return () => _c$4() && (() => {
|
|
835
|
+
var _el$46 = _$createElement("box");
|
|
836
|
+
_$setProp(_el$46, "width", "100%");
|
|
837
|
+
_$setProp(_el$46, "flexDirection", "column");
|
|
838
|
+
_$insert(_el$46, (() => {
|
|
839
|
+
var _c$8 = _$memo(() => !!compactionOff());
|
|
840
|
+
return () => _c$8() ? compactionOffSidebarRows(s()).map(row => _$createComponent(StatRow, {
|
|
868
841
|
get theme() {
|
|
869
842
|
return props.theme;
|
|
870
843
|
},
|
|
871
|
-
get
|
|
872
|
-
return
|
|
844
|
+
get label() {
|
|
845
|
+
return row.label;
|
|
846
|
+
},
|
|
847
|
+
get value() {
|
|
848
|
+
return row.value;
|
|
849
|
+
},
|
|
850
|
+
get accent() {
|
|
851
|
+
return row.label === "Memories";
|
|
852
|
+
},
|
|
853
|
+
get dim() {
|
|
854
|
+
return row.label !== "Memories";
|
|
873
855
|
}
|
|
874
|
-
})
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
856
|
+
})) : [(() => {
|
|
857
|
+
var _el$47 = _$createElement("box"),
|
|
858
|
+
_el$48 = _$createElement("text");
|
|
859
|
+
_$insertNode(_el$47, _el$48);
|
|
860
|
+
_$setProp(_el$47, "width", "100%");
|
|
861
|
+
_$setProp(_el$47, "flexDirection", "row");
|
|
862
|
+
_$setProp(_el$47, "justifyContent", "space-between");
|
|
863
|
+
_$insertNode(_el$48, _$createTextNode(`Historian`));
|
|
864
|
+
_$insert(_el$47, (() => {
|
|
865
|
+
var _c$9 = _$memo(() => !!s()?.historianRunning);
|
|
866
|
+
return () => _c$9() ? (() => {
|
|
867
|
+
var _el$61 = _$createElement("text");
|
|
868
|
+
_$insertNode(_el$61, _$createTextNode(`comparting ⟳`));
|
|
869
|
+
_$effect(_$p => _$setProp(_el$61, "fg", props.theme.warning, _$p));
|
|
870
|
+
return _el$61;
|
|
871
|
+
})() : (() => {
|
|
872
|
+
var _el$63 = _$createElement("text");
|
|
873
|
+
_$insertNode(_el$63, _$createTextNode(`idle`));
|
|
874
|
+
_$effect(_$p => _$setProp(_el$63, "fg", props.theme.textMuted, _$p));
|
|
875
|
+
return _el$63;
|
|
876
|
+
})();
|
|
877
|
+
})(), null);
|
|
878
|
+
_$effect(_$p => _$setProp(_el$48, "fg", props.theme.textMuted, _$p));
|
|
879
|
+
return _el$47;
|
|
880
|
+
})(), (() => {
|
|
881
|
+
var _el$50 = _$createElement("box"),
|
|
882
|
+
_el$51 = _$createElement("text"),
|
|
883
|
+
_el$53 = _$createElement("text");
|
|
884
|
+
_$insertNode(_el$50, _el$51);
|
|
885
|
+
_$insertNode(_el$50, _el$53);
|
|
886
|
+
_$setProp(_el$50, "width", "100%");
|
|
887
|
+
_$setProp(_el$50, "flexDirection", "row");
|
|
888
|
+
_$setProp(_el$50, "justifyContent", "space-between");
|
|
889
|
+
_$insertNode(_el$51, _$createTextNode(`Memories`));
|
|
890
|
+
_$insert(_el$53, (() => {
|
|
891
|
+
var _c$0 = _$memo(() => (s()?.memoryBlockCount ?? 0) > 0);
|
|
892
|
+
return () => _c$0() ? `${s().memoryBlockCount}/${s()?.memoryCount ?? 0}` : String(s()?.memoryCount ?? 0);
|
|
893
|
+
})());
|
|
894
|
+
_$effect(_p$ => {
|
|
895
|
+
var _v$15 = props.theme.textMuted,
|
|
896
|
+
_v$16 = props.theme.textMuted;
|
|
897
|
+
_v$15 !== _p$.e && (_p$.e = _$setProp(_el$51, "fg", _v$15, _p$.e));
|
|
898
|
+
_v$16 !== _p$.t && (_p$.t = _$setProp(_el$53, "fg", _v$16, _p$.t));
|
|
899
|
+
return _p$;
|
|
900
|
+
}, {
|
|
901
|
+
e: undefined,
|
|
902
|
+
t: undefined
|
|
903
|
+
});
|
|
904
|
+
return _el$50;
|
|
905
|
+
})(), (() => {
|
|
906
|
+
var _el$54 = _$createElement("box"),
|
|
907
|
+
_el$55 = _$createElement("text"),
|
|
908
|
+
_el$57 = _$createElement("text"),
|
|
909
|
+
_el$58 = _$createTextNode(`C:`),
|
|
910
|
+
_el$59 = _$createTextNode(` Q:`),
|
|
911
|
+
_el$60 = _$createTextNode(` N:`);
|
|
912
|
+
_$insertNode(_el$54, _el$55);
|
|
913
|
+
_$insertNode(_el$54, _el$57);
|
|
914
|
+
_$setProp(_el$54, "width", "100%");
|
|
915
|
+
_$setProp(_el$54, "flexDirection", "row");
|
|
916
|
+
_$setProp(_el$54, "justifyContent", "space-between");
|
|
917
|
+
_$insertNode(_el$55, _$createTextNode(`Status`));
|
|
918
|
+
_$insertNode(_el$57, _el$58);
|
|
919
|
+
_$insertNode(_el$57, _el$59);
|
|
920
|
+
_$insertNode(_el$57, _el$60);
|
|
921
|
+
_$insert(_el$57, () => s()?.compartmentCount ?? 0, _el$59);
|
|
922
|
+
_$insert(_el$57, () => s()?.pendingOpsCount ?? 0, _el$60);
|
|
923
|
+
_$insert(_el$57, () => s()?.sessionNoteCount ?? 0, null);
|
|
924
|
+
_$effect(_p$ => {
|
|
925
|
+
var _v$17 = props.theme.textMuted,
|
|
926
|
+
_v$18 = props.theme.textMuted;
|
|
927
|
+
_v$17 !== _p$.e && (_p$.e = _$setProp(_el$55, "fg", _v$17, _p$.e));
|
|
928
|
+
_v$18 !== _p$.t && (_p$.t = _$setProp(_el$57, "fg", _v$18, _p$.t));
|
|
929
|
+
return _p$;
|
|
930
|
+
}, {
|
|
931
|
+
e: undefined,
|
|
932
|
+
t: undefined
|
|
933
|
+
});
|
|
934
|
+
return _el$54;
|
|
935
|
+
})(), _$createComponent(Show, {
|
|
936
|
+
get when() {
|
|
937
|
+
return s()?.recompProgress;
|
|
938
|
+
},
|
|
939
|
+
children: progress => _$createComponent(RecompProgressSection, {
|
|
940
|
+
get theme() {
|
|
941
|
+
return props.theme;
|
|
942
|
+
},
|
|
943
|
+
get progress() {
|
|
944
|
+
return progress();
|
|
945
|
+
}
|
|
946
|
+
})
|
|
947
|
+
})];
|
|
948
|
+
})());
|
|
949
|
+
return _el$46;
|
|
896
950
|
})();
|
|
897
951
|
})(), null);
|
|
898
952
|
_$insert(_el$25, (() => {
|
|
899
|
-
var _c$
|
|
900
|
-
return () => _c$
|
|
901
|
-
var _el$
|
|
902
|
-
_el$
|
|
903
|
-
_el$
|
|
904
|
-
_$insertNode(_el$
|
|
905
|
-
_$setProp(_el$
|
|
906
|
-
_$setProp(_el$
|
|
907
|
-
_$setProp(_el$
|
|
908
|
-
_$setProp(_el$
|
|
909
|
-
_$insertNode(_el$
|
|
910
|
-
_$insertNode(_el$
|
|
911
|
-
_$insert(_el$
|
|
912
|
-
var _c$
|
|
913
|
-
return () => _c$
|
|
914
|
-
var _el$
|
|
915
|
-
_$insertNode(_el$
|
|
916
|
-
_$effect(_$p => _$setProp(_el$
|
|
917
|
-
return _el$
|
|
953
|
+
var _c$5 = _$memo(() => !!!collapsed());
|
|
954
|
+
return () => _c$5() && [_$memo(() => _$memo(() => !!(!compactionOff() && sections().historian))() && [(() => {
|
|
955
|
+
var _el$65 = _$createElement("box"),
|
|
956
|
+
_el$66 = _$createElement("text"),
|
|
957
|
+
_el$67 = _$createElement("b");
|
|
958
|
+
_$insertNode(_el$65, _el$66);
|
|
959
|
+
_$setProp(_el$65, "width", "100%");
|
|
960
|
+
_$setProp(_el$65, "marginTop", 1);
|
|
961
|
+
_$setProp(_el$65, "flexDirection", "row");
|
|
962
|
+
_$setProp(_el$65, "justifyContent", "space-between");
|
|
963
|
+
_$insertNode(_el$66, _el$67);
|
|
964
|
+
_$insertNode(_el$67, _$createTextNode(`Historian`));
|
|
965
|
+
_$insert(_el$65, (() => {
|
|
966
|
+
var _c$1 = _$memo(() => !!s()?.historianRunning);
|
|
967
|
+
return () => _c$1() ? (() => {
|
|
968
|
+
var _el$69 = _$createElement("text");
|
|
969
|
+
_$insertNode(_el$69, _$createTextNode(`comparting ⟳`));
|
|
970
|
+
_$effect(_$p => _$setProp(_el$69, "fg", props.theme.warning, _$p));
|
|
971
|
+
return _el$69;
|
|
918
972
|
})() : (() => {
|
|
919
|
-
var _el$
|
|
920
|
-
_$insertNode(_el$
|
|
921
|
-
_$effect(_$p => _$setProp(_el$
|
|
922
|
-
return _el$
|
|
973
|
+
var _el$71 = _$createElement("text");
|
|
974
|
+
_$insertNode(_el$71, _$createTextNode(`idle`));
|
|
975
|
+
_$effect(_$p => _$setProp(_el$71, "fg", props.theme.textMuted, _$p));
|
|
976
|
+
return _el$71;
|
|
923
977
|
})();
|
|
924
978
|
})(), null);
|
|
925
|
-
_$effect(_$p => _$setProp(_el$
|
|
926
|
-
return _el$
|
|
979
|
+
_$effect(_$p => _$setProp(_el$66, "fg", props.theme.text, _$p));
|
|
980
|
+
return _el$65;
|
|
927
981
|
})(), _$createComponent(StatRow, {
|
|
928
982
|
get theme() {
|
|
929
983
|
return props.theme;
|
|
@@ -949,7 +1003,18 @@ const SidebarContent = props => {
|
|
|
949
1003
|
return props.theme;
|
|
950
1004
|
},
|
|
951
1005
|
title: "Memory"
|
|
952
|
-
}), _$createComponent(StatRow, {
|
|
1006
|
+
}), _$memo(() => _$memo(() => !!compactionOff())() ? compactionOffSidebarRows(s()).filter(row => row.label === "Memories").map(row => _$createComponent(StatRow, {
|
|
1007
|
+
get theme() {
|
|
1008
|
+
return props.theme;
|
|
1009
|
+
},
|
|
1010
|
+
get label() {
|
|
1011
|
+
return row.label;
|
|
1012
|
+
},
|
|
1013
|
+
get value() {
|
|
1014
|
+
return row.value;
|
|
1015
|
+
},
|
|
1016
|
+
accent: true
|
|
1017
|
+
})) : [_$createComponent(StatRow, {
|
|
953
1018
|
get theme() {
|
|
954
1019
|
return props.theme;
|
|
955
1020
|
},
|
|
@@ -967,12 +1032,23 @@ const SidebarContent = props => {
|
|
|
967
1032
|
return String(s().memoryBlockCount);
|
|
968
1033
|
},
|
|
969
1034
|
dim: true
|
|
970
|
-
}))]), _$memo(() => _$memo(() => !!(sections().status && ((s()?.pendingOpsCount ?? 0) > 0 || (s()?.sessionNoteCount ?? 0) > 0 || (s()?.readySmartNoteCount ?? 0) > 0)))() && [_$createComponent(SectionHeader, {
|
|
1035
|
+
}))])]), _$memo(() => _$memo(() => !!(sections().status && (compactionOff() || (s()?.pendingOpsCount ?? 0) > 0 || (s()?.sessionNoteCount ?? 0) > 0 || (s()?.readySmartNoteCount ?? 0) > 0)))() && [_$createComponent(SectionHeader, {
|
|
971
1036
|
get theme() {
|
|
972
1037
|
return props.theme;
|
|
973
1038
|
},
|
|
974
1039
|
title: "Status"
|
|
975
|
-
}), _$memo(() => _$memo(() => (
|
|
1040
|
+
}), _$memo(() => _$memo(() => !!compactionOff())() ? compactionOffSidebarRows(s()).filter(row => row.label !== "Memories").map(row => _$createComponent(StatRow, {
|
|
1041
|
+
get theme() {
|
|
1042
|
+
return props.theme;
|
|
1043
|
+
},
|
|
1044
|
+
get label() {
|
|
1045
|
+
return row.label;
|
|
1046
|
+
},
|
|
1047
|
+
get value() {
|
|
1048
|
+
return row.value;
|
|
1049
|
+
},
|
|
1050
|
+
dim: true
|
|
1051
|
+
})) : [_$memo(() => _$memo(() => (s()?.pendingOpsCount ?? 0) > 0)() && _$createComponent(StatRow, {
|
|
976
1052
|
get theme() {
|
|
977
1053
|
return props.theme;
|
|
978
1054
|
},
|
|
@@ -998,7 +1074,7 @@ const SidebarContent = props => {
|
|
|
998
1074
|
return `${s().readySmartNoteCount} ready`;
|
|
999
1075
|
},
|
|
1000
1076
|
accent: true
|
|
1001
|
-
}))]), _$memo(() => _$memo(() => !!(sections().dreamer && s()?.lastDreamerRunAt))() && [_$createComponent(SectionHeader, {
|
|
1077
|
+
}))])]), _$memo(() => _$memo(() => !!(sections().dreamer && s()?.lastDreamerRunAt))() && [_$createComponent(SectionHeader, {
|
|
1002
1078
|
get theme() {
|
|
1003
1079
|
return props.theme;
|
|
1004
1080
|
},
|
package/dist/config/schema.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/config/schema.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC"}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import type { Database } from "../../shared/sqlite";
|
|
2
|
-
/**
|
|
3
|
-
* SQLite-backed message bus for TUI ↔ server plugin communication.
|
|
4
|
-
*
|
|
5
|
-
* Both the server plugin and TUI plugin share the same `context.db`.
|
|
6
|
-
* Messages are written by one side and consumed by the other via polling.
|
|
7
|
-
*
|
|
8
|
-
* Directions:
|
|
9
|
-
* - "server_to_tui": Server sends toasts, dialogs, state updates to TUI
|
|
10
|
-
* - "tui_to_server": TUI sends dialog confirmations, action triggers to server
|
|
11
|
-
*
|
|
12
|
-
* Message types:
|
|
13
|
-
* - "toast": Show a toast notification { message, variant?, duration? }
|
|
14
|
-
* - "dialog_confirm": Show a confirmation dialog { id, title, message }
|
|
15
|
-
* - "dialog_result": TUI response to a dialog { id, confirmed }
|
|
16
|
-
* - "state_update": State change hint { key, value }
|
|
17
|
-
*
|
|
18
|
-
* Messages are auto-cleaned after 5 minutes to prevent table bloat.
|
|
19
|
-
*/
|
|
20
|
-
export type MessageDirection = "server_to_tui" | "tui_to_server";
|
|
21
|
-
export type MessageType = "toast" | "dialog_confirm" | "dialog_result" | "state_update" | "action";
|
|
22
|
-
export interface PluginMessage {
|
|
23
|
-
id: number;
|
|
24
|
-
direction: MessageDirection;
|
|
25
|
-
type: MessageType;
|
|
26
|
-
payload: Record<string, unknown>;
|
|
27
|
-
sessionId: string | null;
|
|
28
|
-
createdAt: number;
|
|
29
|
-
consumedAt: number | null;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Send a message from server to TUI.
|
|
33
|
-
*/
|
|
34
|
-
export declare function sendToTui(db: Database, type: MessageType, payload: Record<string, unknown>, sessionId?: string): number;
|
|
35
|
-
/**
|
|
36
|
-
* Send a message from TUI to server.
|
|
37
|
-
*/
|
|
38
|
-
export declare function sendToServer(db: Database, type: MessageType, payload: Record<string, unknown>, sessionId?: string): number;
|
|
39
|
-
/**
|
|
40
|
-
* Consume unconsumed messages for a given direction.
|
|
41
|
-
* Marks consumed messages and returns them.
|
|
42
|
-
* Also cleans up old messages (>5min) to prevent table bloat.
|
|
43
|
-
*/
|
|
44
|
-
export declare function consumeMessages(db: Database, direction: MessageDirection, options?: {
|
|
45
|
-
type?: MessageType;
|
|
46
|
-
sessionId?: string;
|
|
47
|
-
}): PluginMessage[];
|
|
48
|
-
/**
|
|
49
|
-
* Peek at unconsumed messages without consuming them.
|
|
50
|
-
*/
|
|
51
|
-
export declare function peekMessages(db: Database, direction: MessageDirection, options?: {
|
|
52
|
-
type?: MessageType;
|
|
53
|
-
sessionId?: string;
|
|
54
|
-
}): PluginMessage[];
|
|
55
|
-
/**
|
|
56
|
-
* Convenience: send a toast to TUI.
|
|
57
|
-
*/
|
|
58
|
-
export declare function sendTuiToast(db: Database, message: string, options?: {
|
|
59
|
-
variant?: "info" | "warning" | "error" | "success";
|
|
60
|
-
duration?: number;
|
|
61
|
-
sessionId?: string;
|
|
62
|
-
}): number;
|
|
63
|
-
/**
|
|
64
|
-
* Convenience: send a confirmation dialog request to TUI.
|
|
65
|
-
* Returns the message ID which the TUI will reference in its dialog_result response.
|
|
66
|
-
*/
|
|
67
|
-
export declare function sendTuiConfirmDialog(db: Database, id: string, title: string, message: string, sessionId?: string): number;
|
|
68
|
-
/**
|
|
69
|
-
* Convenience: check for a dialog result from TUI.
|
|
70
|
-
* Returns the confirmation result or null if not yet responded.
|
|
71
|
-
*/
|
|
72
|
-
export declare function checkDialogResult(db: Database, dialogId: string): {
|
|
73
|
-
confirmed: boolean;
|
|
74
|
-
} | null;
|
|
75
|
-
//# sourceMappingURL=plugin-messages.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-messages.d.ts","sourceRoot":"","sources":["../../../src/features/magic-context/plugin-messages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAEpD;;;;;;;;;;;;;;;;;GAiBG;AAEH,MAAM,MAAM,gBAAgB,GAAG,eAAe,GAAG,eAAe,CAAC;AAEjE,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,gBAAgB,GAAG,eAAe,GAAG,cAAc,GAAG,QAAQ,CAAC;AAEnG,MAAM,WAAW,aAAa;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,gBAAgB,CAAC;IAC5B,IAAI,EAAE,WAAW,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AA6CD;;GAEG;AACH,wBAAgB,SAAS,CACrB,EAAE,EAAE,QAAQ,EACZ,IAAI,EAAE,WAAW,EACjB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,SAAS,CAAC,EAAE,MAAM,GACnB,MAAM,CAOR;AAED;;GAEG;AACH,wBAAgB,YAAY,CACxB,EAAE,EAAE,QAAQ,EACZ,IAAI,EAAE,WAAW,EACjB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,SAAS,CAAC,EAAE,MAAM,GACnB,MAAM,CAOR;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAC3B,EAAE,EAAE,QAAQ,EACZ,SAAS,EAAE,gBAAgB,EAC3B,OAAO,CAAC,EAAE;IAAE,IAAI,CAAC,EAAE,WAAW,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GACrD,aAAa,EAAE,CAsCjB;AAED;;GAEG;AACH,wBAAgB,YAAY,CACxB,EAAE,EAAE,QAAQ,EACZ,SAAS,EAAE,gBAAgB,EAC3B,OAAO,CAAC,EAAE;IAAE,IAAI,CAAC,EAAE,WAAW,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GACrD,aAAa,EAAE,CAmBjB;AAED;;GAEG;AACH,wBAAgB,YAAY,CACxB,EAAE,EAAE,QAAQ,EACZ,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE;IACN,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;IACnD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,GACF,MAAM,CAWR;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAChC,EAAE,EAAE,QAAQ,EACZ,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EACf,SAAS,CAAC,EAAE,MAAM,GACnB,MAAM,CAER;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,GAAG;IAAE,SAAS,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,CAK/F"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { CandidateCompartment } from "./compartment-runner-types";
|
|
2
|
-
export declare function buildExistingStateXml(compartments: Array<{
|
|
3
|
-
startMessage: number;
|
|
4
|
-
endMessage: number;
|
|
5
|
-
startMessageId: string;
|
|
6
|
-
endMessageId: string;
|
|
7
|
-
title: string;
|
|
8
|
-
content: string;
|
|
9
|
-
}>, facts: Array<{
|
|
10
|
-
category: string;
|
|
11
|
-
content: string;
|
|
12
|
-
}>, memoryBlock?: string): string;
|
|
13
|
-
export declare function mergePriorCompartments(priorCompartments: Array<{
|
|
14
|
-
startMessage: number;
|
|
15
|
-
endMessage: number;
|
|
16
|
-
startMessageId: string;
|
|
17
|
-
endMessageId: string;
|
|
18
|
-
title: string;
|
|
19
|
-
content: string;
|
|
20
|
-
}>, newCompartments: CandidateCompartment[]): CandidateCompartment[];
|
|
21
|
-
//# sourceMappingURL=compartment-runner-state-xml.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"compartment-runner-state-xml.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/compartment-runner-state-xml.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAEvE,wBAAgB,qBAAqB,CACjC,YAAY,EAAE,KAAK,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACnB,CAAC,EACF,KAAK,EAAE,KAAK,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,EACnD,WAAW,CAAC,EAAE,MAAM,GACrB,MAAM,CA2CR;AAED,wBAAgB,sBAAsB,CAClC,iBAAiB,EAAE,KAAK,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACnB,CAAC,EACF,eAAe,EAAE,oBAAoB,EAAE,GACxC,oBAAoB,EAAE,CAaxB"}
|