minecodex 2.0.18 → 2.0.20
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/apps/dashboard/app.js +10 -3
- package/apps/dashboard/index.html +2 -0
- package/apps/dashboard/styles.css +8 -3
- package/features/notes/assets/icons/prompt-entry-selected.svg +1 -1
- package/features/notes/src/adapters/codex/insertion.mjs +1 -1
- package/package.json +1 -1
- package/packages/codex-adapter/src/renderer/environment.mjs +3 -1
- package/packages/plugin/assets/app.js +11 -11
- package/packages/plugin/assets/prompts.js +2 -2
- package/packages/plugin/src/prompts-app.mjs +1 -1
- package/packages/plugin/src/server.mjs +21 -6
- package/packages/plugin/src/version.mjs +1 -0
- package/packages/ui/src/native/mcp-theme.css +2 -0
- package/packages/ui/src/native/mcp-theme.mjs +1 -1
package/apps/dashboard/app.js
CHANGED
|
@@ -421,7 +421,9 @@ elements.updateButton.addEventListener("click", async () => {
|
|
|
421
421
|
|
|
422
422
|
const systemTheme = matchMedia("(prefers-color-scheme: dark)");
|
|
423
423
|
let selectedTheme = null;
|
|
424
|
-
|
|
424
|
+
if (!window.minecodexMcpApp) {
|
|
425
|
+
try { selectedTheme = localStorage.getItem("minecodex-appearance"); } catch { /* 存储不可用时仍允许本次切换。 */ }
|
|
426
|
+
}
|
|
425
427
|
function applyTheme() {
|
|
426
428
|
const hostDark = window.minecodexHostTheme ? window.minecodexHostTheme === "dark" : systemTheme.matches;
|
|
427
429
|
const dark = selectedTheme === "dark" || (selectedTheme !== "light" && hostDark);
|
|
@@ -436,7 +438,9 @@ elements.themeToggle.addEventListener("click", (event) => {
|
|
|
436
438
|
const button = event.target.closest("[data-theme-choice]");
|
|
437
439
|
if (!button) return;
|
|
438
440
|
selectedTheme = button.dataset.themeChoice;
|
|
439
|
-
|
|
441
|
+
if (!window.minecodexMcpApp) {
|
|
442
|
+
try { localStorage.setItem("minecodex-appearance", selectedTheme); } catch { /* 保留内存中的选择。 */ }
|
|
443
|
+
}
|
|
440
444
|
applyTheme();
|
|
441
445
|
});
|
|
442
446
|
elements.languageToggle.addEventListener("click", (event) => {
|
|
@@ -449,7 +453,10 @@ elements.languageToggle.addEventListener("click", (event) => {
|
|
|
449
453
|
location.reload();
|
|
450
454
|
});
|
|
451
455
|
systemTheme.addEventListener("change", applyTheme);
|
|
452
|
-
window.addEventListener("minecodex-host-theme",
|
|
456
|
+
window.addEventListener("minecodex-host-theme", () => {
|
|
457
|
+
selectedTheme = null;
|
|
458
|
+
applyTheme();
|
|
459
|
+
});
|
|
453
460
|
document.addEventListener("keydown", () => { document.documentElement.dataset.input = "keyboard"; });
|
|
454
461
|
document.addEventListener("pointerdown", () => { document.documentElement.dataset.input = "pointer"; });
|
|
455
462
|
applyStaticCopy();
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
<script type="module" src="/assets/data-transfer.js"></script>
|
|
13
13
|
</head>
|
|
14
14
|
<body>
|
|
15
|
+
<div class="dashboard-surface">
|
|
15
16
|
<canvas id="agent-world" aria-hidden="true"></canvas>
|
|
16
17
|
<main class="shell">
|
|
17
18
|
<header class="page-header">
|
|
@@ -87,5 +88,6 @@
|
|
|
87
88
|
<input id="data-file" type="file" accept=".json,.mcx.json,application/json" hidden>
|
|
88
89
|
</dialog>
|
|
89
90
|
<div id="toast" class="toast" hidden role="status" aria-live="polite"></div>
|
|
91
|
+
</div>
|
|
90
92
|
</body>
|
|
91
93
|
</html>
|
|
@@ -65,13 +65,18 @@ body {
|
|
|
65
65
|
min-width: 320px;
|
|
66
66
|
min-height: 100vh;
|
|
67
67
|
margin: 0;
|
|
68
|
+
color: var(--ink);
|
|
69
|
+
font-size: 14px;
|
|
70
|
+
-webkit-font-smoothing: antialiased;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/* 官方页面强制设置 body 背景;内容面拥有控制台自身的明暗色板。 */
|
|
74
|
+
.dashboard-surface {
|
|
75
|
+
min-height: 100vh;
|
|
68
76
|
background-color: var(--canvas);
|
|
69
77
|
background-image: radial-gradient(ellipse at 50% 0%, var(--accent-soft), transparent 75%);
|
|
70
78
|
background-repeat: no-repeat;
|
|
71
79
|
background-attachment: fixed;
|
|
72
|
-
color: var(--ink);
|
|
73
|
-
font-size: 14px;
|
|
74
|
-
-webkit-font-smoothing: antialiased;
|
|
75
80
|
}
|
|
76
81
|
|
|
77
82
|
#agent-world { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg" viewBox="
|
|
1
|
+
<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg" viewBox="-12 -12 280 280" fill="currentColor"><path d="M240,56V200a8,8,0,0,1-8,8H160a24,24,0,0,0-24,23.94,7.9,7.9,0,0,1-5.12,7.55A8,8,0,0,1,120,232a24,24,0,0,0-24-24H24a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8H88a32,32,0,0,1,32,32v87.73a8.17,8.17,0,0,0,7.47,8.25,8,8,0,0,0,8.53-8V80a32,32,0,0,1,32-32h64A8,8,0,0,1,240,56Z"/></svg>
|
|
@@ -34,7 +34,7 @@ export function installPromptInsertion(signal, {codex, api, insertText}) {
|
|
|
34
34
|
async function receive(event) {
|
|
35
35
|
if (event.data?.type !== 'minecodex:insert-prompt' || typeof event.data.promptId !== 'string') return;
|
|
36
36
|
const port = event.ports?.[0];
|
|
37
|
-
const source = codex.mcpAppSource(event.source,{server:'minecodex',pluginId:'minecodex@minecodex-local',resourceUri
|
|
37
|
+
const source = codex.mcpAppSource(event.source,{server:'minecodex',pluginId:'minecodex@minecodex-local',resourceUri:/^ui:\/\/minecodex\/(?:\d+\.\d+\.\d+\/)?prompts\.html$/});
|
|
38
38
|
if (!source || !port) return;
|
|
39
39
|
if (busy || !document.hasFocus()) {port.postMessage({error:'Input changed before insertion'});port.close();return;}
|
|
40
40
|
busy = true;
|
package/package.json
CHANGED
|
@@ -89,7 +89,9 @@ export function createCodexEnvironment() {
|
|
|
89
89
|
}
|
|
90
90
|
if (!matches) continue;
|
|
91
91
|
const view = props(frame, value => value.view?.resourceUri != null)?.view;
|
|
92
|
-
|
|
92
|
+
const matchesResource = typeof resourceUri === 'string' ? view?.resourceUri === resourceUri
|
|
93
|
+
: typeof view?.resourceUri === 'string' && resourceUri.test(view.resourceUri);
|
|
94
|
+
if (matchesResource && (view.server === server || view.pluginId === pluginId))
|
|
93
95
|
return {connected:() => frame.isConnected};
|
|
94
96
|
}
|
|
95
97
|
return null;
|